Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--write-sub causes AttributeError: 'tuple' object has no attribute 'keys' #753

Closed
ivan opened this issue Mar 25, 2013 · 2 comments
Closed

--write-sub causes AttributeError: 'tuple' object has no attribute 'keys' #753

ivan opened this issue Mar 25, 2013 · 2 comments

Comments

@ivan
Copy link
Contributor

@ivan ivan commented Mar 25, 2013

$ git rev-parse HEAD
f10b2a9c14db686e7f9b7d050f41b26d5cc35e01

$ python -m youtube_dl --write-sub "https://www.youtube.com/watch?v=sZtfnC2CyU0"
[youtube] Setting language
[youtube] sZtfnC2CyU0: Downloading video webpage
[youtube] sZtfnC2CyU0: Downloading video info webpage
[youtube] sZtfnC2CyU0: Extracting video information
[youtube] sZtfnC2CyU0: Checking available subtitles
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/at/trash/youtube-dl/youtube_dl/__main__.py", line 17, in <module>
    youtube_dl.main()
  File "youtube_dl/__init__.py", line 540, in main
    _real_main()
  File "youtube_dl/__init__.py", line 524, in _real_main
    retcode = fd.download(all_urls)
  File "youtube_dl/FileDownloader.py", line 547, in download
    videos = ie.extract(url)
  File "youtube_dl/InfoExtractors.py", line 96, in extract
    return self._real_extract(url)
  File "youtube_dl/InfoExtractors.py", line 531, in _real_extract
    video_subtitles = self._extract_subtitle(video_id)
  File "youtube_dl/InfoExtractors.py", line 292, in _extract_subtitle
    sub_lang = list(sub_lang_list.keys())[0]
AttributeError: 'tuple' object has no attribute 'keys'
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Mar 30, 2013

The problem is that youtube-dl doesn't find subtitles and _get_available_subtitles returns a tuple with the warning message

@FiloSottile
Copy link
Collaborator

@FiloSottile FiloSottile commented Apr 1, 2013

Fixed by @jaimeMF in #764

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.