aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/watch.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2019-12-18 19:43:55 -0800
committerJames Taylor <user234683@users.noreply.github.com>2019-12-18 19:43:55 -0800
commitf6bf5213a579b16e17e8d72b51b090ffe4bc9bdb (patch)
tree094ad04de7009decc515f9b60a0050082c05edd1 /youtube/watch.py
parent98777ee82561ae205f156a7f8497728aecfa080c (diff)
downloadyt-local-f6bf5213a579b16e17e8d72b51b090ffe4bc9bdb.tar.lz
yt-local-f6bf5213a579b16e17e8d72b51b090ffe4bc9bdb.tar.xz
yt-local-f6bf5213a579b16e17e8d72b51b090ffe4bc9bdb.zip
Extraction: rename multi_get functions to more descriptive names
Diffstat (limited to 'youtube/watch.py')
-rw-r--r--youtube/watch.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/youtube/watch.py b/youtube/watch.py
index 2118319..69ab87b 100644
--- a/youtube/watch.py
+++ b/youtube/watch.py
@@ -185,7 +185,7 @@ def decrypt_signatures(info):
return False # No decryption needed
if not info['base_js']:
return 'Failed to find base.js'
- player_name = yt_data_extract.default_get(info['base_js'].split('/'), -2)
+ player_name = yt_data_extract.get(info['base_js'].split('/'), -2)
if not player_name:
return 'Could not find player name'
@@ -204,7 +204,7 @@ def decrypt_signatures(info):
if not function_body:
return 'Empty decryption function body'
- var_name = yt_data_extract.default_get(function_body[0].split('.'), 0)
+ var_name = yt_data_extract.get(function_body[0].split('.'), 0)
if var_name is None:
return 'Could not find var_name'
@@ -397,8 +397,8 @@ def get_watch_page():
})
video_sources = get_video_sources(info)
- video_height = yt_data_extract.default_multi_get(video_sources, 0, 'height', default=360)
- video_width = yt_data_extract.default_multi_get(video_sources, 0, 'width', default=640)
+ video_height = yt_data_extract.deep_get(video_sources, 0, 'height', default=360)
+ video_width = yt_data_extract.deep_get(video_sources, 0, 'width', default=640)
# 1 second per pixel, or the actual video width
theater_video_target_width = max(640, info['duration'] or 0, video_width)