Extraction: Move stuff around in files and put underscores in front of internal helper function names

Move get_captions_url in watch_extraction to bottom next to other exported, public functions
This commit is contained in:
James Taylor
2019-12-19 20:12:37 -08:00
parent d1d908d5b1
commit 4a3529df95
3 changed files with 37 additions and 38 deletions

View File

@@ -192,7 +192,7 @@ def extract_playlist_info(polymer_json):
return info
def ctoken_metadata(ctoken):
def _ctoken_metadata(ctoken):
result = dict()
params = proto.parse(proto.b64_to_bytes(ctoken))
result['video_id'] = proto.parse(params[2])[2].decode('ascii')
@@ -220,7 +220,7 @@ def extract_comments_info(polymer_json):
url = multi_deep_get(polymer_json, [1, 'url'], ['url'])
if url:
ctoken = urllib.parse.parse_qs(url[url.find('?')+1:])['ctoken'][0]
metadata = ctoken_metadata(ctoken)
metadata = _ctoken_metadata(ctoken)
else:
metadata = {}
info['video_id'] = metadata.get('video_id')