yturl
yturl copied to clipboard
KeyError: 'url_encoded_fmt_stream_map'
I get the following error when running yturl 'http://www.youtube.com/watch?v=8TCxE0bWQeQ':
Traceback (most recent call last):
File "/usr/local/bin/yturl", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/yturl.py", line 147, in main
itag_to_url_map = itags_for_video(args.video_id)
File "/usr/local/lib/python3.7/site-packages/yturl.py", line 80, in itags_for_video
streams = api_response['url_encoded_fmt_stream_map'].split(',')
KeyError: 'url_encoded_fmt_stream_map'
It seems to be an issue with YouTube not returning some metadata for certain videos. pytube has fixed it in https://github.com/nficano/pytube/issues/467, https://github.com/nficano/pytube/pull/534/commits/e5f1a9e2476b096ed2012939d50851d3499016e1
Edit: Didn't realise this issue has already been raised and closed, but I'll leave this open for now in case the above fixes in pytube have not been considered.