Closed JanX2 closed 7 years ago
The issue here is that unfortunately every version of pycountry
uses different keys for the lookup (The joys of duck typing ...). I now added some more educated guesses and a more helpful error message. Try again commit ce76375 and let me know what it says in case it still fails.
#######################################
#-- Gathering lecture data for 33c3 --#
#######################################
- Info about video files from "cdn.media.ccc.de"
Traceback (most recent call last):
File "/Users/jan/Development/Projects/down-frab-videos/down_frab_videos.py", line 1016, in <module>
builders = [ media_url_builder(selected_event["media_prefix"], format) for format in selected_formats ]
File "/Users/jan/Development/Projects/down-frab-videos/down_frab_videos.py", line 1016, in <listcomp>
builders = [ media_url_builder(selected_event["media_prefix"], format) for format in selected_formats ]
File "/Users/jan/Development/Projects/down-frab-videos/down_frab_videos.py", line 293, in __init__
self.__parse_link(hreftext,self.cached)
File "/Users/jan/Development/Projects/down-frab-videos/down_frab_videos.py", line 432, in __parse_link
+ langmap[key]["url"] + "\".")
__main__.InvalidMediaPageError: Found the language key "deu-eng-fra" twice in the language map. It was generated from both the links "33c3-8429-eng-deu-fra-33C3_Opening_Ceremony.en.srt" as well as "https://cdn.media.ccc.de/congress/2016/subtitles/33c3-8429-eng-deu-fra-33C3_Opening_Ceremony.de.srt".
Ok at least now we have a different issue ... apparently downloading subtitles does not work yet.
I'll quickly code a version of the script where such invalid media page entries don't yield to an abortion of the script. I hope you did not care about the opening ceremony which caused this stacktrace ;)
Quick fix pushed as d41f920.
Finishes launching and started processing again with the fix. Let’s see how long it will survive. :D
BTW: This is the first time the script ran through all the way for me. :)
This is with Python 3.6.0. Finally upgraded. ;)
Happened with 2.7 as well (before upgrading).
Both times a
pip install pycountry
was necessary, of course.