YouTubeResource now uses proxy download by default (set useproxy=False when initializing if you don't need proxy)
call yt_resource.get_resource_info() to get ricecooker-like dict of metadata. If you need the raw info dict returend by YoutubeDL access yt_resource.info
call yt_resource.download(base_dir) to get metadata AND download the files (resource and children will have filename attribute)
call yt_resource.get_resource_subtitles() to obtain the raw YoutubeDL info_dict metadata, which contains subtitles under the subtitles key
Changes since last week:
use proxy only for getting metadata
added ignoreerrors = True to options
This avoids erroring out when hitting private/geolocked videos (this results in new problems extract_info returns None or if it's a playlist, the result will have entires a list of None values). We handle those cases by re-raising (a ValueError).
Summary of usage:
YouTubeResource
now uses proxy download by default (set useproxy=False when initializing if you don't need proxy)yt_resource.get_resource_info()
to get ricecooker-like dict of metadata. If you need the raw info dict returend by YoutubeDL accessyt_resource.info
yt_resource.download(base_dir)
to get metadata AND download the files (resource and children will havefilename
attribute)yt_resource.get_resource_subtitles()
to obtain the raw YoutubeDL info_dict metadata, which contains subtitles under thesubtitles
keyChanges since last week:
use proxy only for getting metadata
added
ignoreerrors = True
to optionsThis avoids erroring out when hitting private/geolocked videos (this results in new problems extract_info returns None or if it's a playlist, the result will have
entires
a list of None values). We handle those cases by re-raising (a ValueError).I'm not sure about this change: maybe the de previous behaviour was better --- raise exception rather than try to handle None cases manually. If we get rid of the
ignoreerrors = True
change these lines won't be necessary https://github.com/learningequality/pressurecooker/blob/008ca2303c6f38dc6ba193ba3485d7d531c67846/pressurecooker/youtube.py#L97-L100high_resolution=False by default
Defaults to downloading 480 videos, if set high_resolution=True will download 720 videos