Petar Marić  committed 755867c

Updated supported subtitle language markers as TED updated their HTML layout, improved error handling.
Thanks to Sam Tygier for the bug report.

  • Participants
  • Parent commits d9b2ee4
  • Branches default

Comments (0)

Files changed (1)

File metaTED/crawler/

-_LANGUAGES_SELECTOR = CSSSelector('div#maincontent div ul li a')
+_LANGUAGES_SELECTOR = CSSSelector('div#content div div ul li a')
 _LANGUAGE_CODE_RE = re.compile('/translate/languages/([\w\-]+)')
+class NoSupportedSubtitleLanguagesFound(Exception):
+    pass
 def get_supported_subtitle_languages():
     logging.debug('Looking for supported subtitle languages...')
     document = html.parse(LANGUAGES_LIST_URL)
             logging.warning("'%s' doesn't seem to be a language", language_name)
+    if not languages:
+        raise NoSupportedSubtitleLanguagesFound('No supported subtitle languages found')
+"Found %d supported subtitle language(s)", len(languages))
     logging.debug("Supported subtitle languages are: %s", languages)
     return languages