[CSpan] UnboundLocalError: local variable 'video_type' referenced before assignment #6501

Closed
opened 2026-02-21 03:18:04 -05:00 by deekerman · 2 comments
Owner

Originally created by @spvkgn on GitHub (Dec 28, 2015).

~ $ youtube-dl -v http://www.c-span.org/video/?319979-1/european-security-ukraine                                                           
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'http://www.c-span.org/video/?319979-1/european-security-ukraine']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.12.23
[debug] Python version 3.2.3 - Linux-3.13.0-68-generic-i686-with-LinuxMint-13-maya
[debug] exe versions: ffmpeg 2.8.3-dpkg, ffprobe 2.8.3-dpkg, rtmpdump 2.4
[debug] Proxy map: {}
[CSpan] 319979: Downloading webpage
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.2/dist-packages/youtube_dl/__init__.py", line 410, in main
    _real_main(argv)
  File "/usr/local/lib/python3.2/dist-packages/youtube_dl/__init__.py", line 400, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/local/lib/python3.2/dist-packages/youtube_dl/YoutubeDL.py", line 1677, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/local/lib/python3.2/dist-packages/youtube_dl/YoutubeDL.py", line 665, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python3.2/dist-packages/youtube_dl/extractor/common.py", line 291, in extract
    return self._real_extract(url)
  File "/usr/local/lib/python3.2/dist-packages/youtube_dl/extractor/cspan.py", line 78, in _real_extract
    'http://www.c-span.org/assets/player/ajax-player.php?os=android&html5=%s&id=%s' % (video_type, video_id),
UnboundLocalError: local variable 'video_type' referenced before assignment
Originally created by @spvkgn on GitHub (Dec 28, 2015). ``` ~ $ youtube-dl -v http://www.c-span.org/video/?319979-1/european-security-ukraine [debug] System config: [] [debug] User config: [] [debug] Command-line args: ['-v', 'http://www.c-span.org/video/?319979-1/european-security-ukraine'] [debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2015.12.23 [debug] Python version 3.2.3 - Linux-3.13.0-68-generic-i686-with-LinuxMint-13-maya [debug] exe versions: ffmpeg 2.8.3-dpkg, ffprobe 2.8.3-dpkg, rtmpdump 2.4 [debug] Proxy map: {} [CSpan] 319979: Downloading webpage Traceback (most recent call last): File "/usr/local/bin/youtube-dl", line 11, in <module> sys.exit(main()) File "/usr/local/lib/python3.2/dist-packages/youtube_dl/__init__.py", line 410, in main _real_main(argv) File "/usr/local/lib/python3.2/dist-packages/youtube_dl/__init__.py", line 400, in _real_main retcode = ydl.download(all_urls) File "/usr/local/lib/python3.2/dist-packages/youtube_dl/YoutubeDL.py", line 1677, in download url, force_generic_extractor=self.params.get('force_generic_extractor', False)) File "/usr/local/lib/python3.2/dist-packages/youtube_dl/YoutubeDL.py", line 665, in extract_info ie_result = ie.extract(url) File "/usr/local/lib/python3.2/dist-packages/youtube_dl/extractor/common.py", line 291, in extract return self._real_extract(url) File "/usr/local/lib/python3.2/dist-packages/youtube_dl/extractor/cspan.py", line 78, in _real_extract 'http://www.c-span.org/assets/player/ajax-player.php?os=android&html5=%s&id=%s' % (video_type, video_id), UnboundLocalError: local variable 'video_type' referenced before assignment ```
deekerman 2026-02-21 03:18:04 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@bonacker commented on GitHub (Dec 28, 2015):

While I was writing this offline about C-Span no longer working, the above person posted the same issue! For what it's worth, I'll post my log as well.

C-Span extractor stopped working
This used to be the format of their webpages containing the video
http://www.c-span.org/video/?328373-1/qa-amy-chozick

Now it's
http://www.c-spanvideo.org/program/Abell

This is the log for http://www.c-spanvideo.org/program/BBCParli

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'-i', u'--write-info-json', u'http://www.c-spanvideo.org/program/BBCParli', u'-o', u'c:/recordings%(title)s.mp5']
[debug] Encodings: locale cp1252, fs mbcs, out None, pref cp1252
[debug] youtube-dl version 2015.12.23
[debug] Python version 2.7.10 - Windows-XP-5.1.2600-SP3
[debug] exe versions: ffmpeg N-76860-g72eaf72, ffprobe N-75426-g8c9853a, rtmpdump 2.3
[debug] Proxy map: {}
[generic] BBCParli: Requesting header
[redirect] Following redirect to http://www.c-span.org/video/?402278-1/bbc-parliament-yearend-review
[CSpan] 402278: Downloading webpage
ERROR: local variable 'video_type' referenced before assignment
Traceback (most recent call last):
File "youtube_dl\YoutubeDL.pyo", line 665, in extract_info
File "youtube_dl\extractor\common.pyo", line 291, in extract
File "youtube_dl\extractor\cspan.pyo", line 78, in _real_extract
UnboundLocalError: local variable 'video_type' referenced before assignment

@bonacker commented on GitHub (Dec 28, 2015): While I was writing this offline about C-Span no longer working, the above person posted the same issue! For what it's worth, I'll post my log as well. C-Span extractor stopped working This used to be the format of their webpages containing the video http://www.c-span.org/video/?328373-1/qa-amy-chozick Now it's http://www.c-spanvideo.org/program/Abell This is the log for http://www.c-spanvideo.org/program/BBCParli [debug] System config: [] [debug] User config: [] [debug] Command-line args: [u'-v', u'-i', u'--write-info-json', u'http://www.c-spanvideo.org/program/BBCParli', u'-o', u'c:/recordings\%(title)s.mp5'] [debug] Encodings: locale cp1252, fs mbcs, out None, pref cp1252 [debug] youtube-dl version 2015.12.23 [debug] Python version 2.7.10 - Windows-XP-5.1.2600-SP3 [debug] exe versions: ffmpeg N-76860-g72eaf72, ffprobe N-75426-g8c9853a, rtmpdump 2.3 [debug] Proxy map: {} [generic] BBCParli: Requesting header [redirect] Following redirect to http://www.c-span.org/video/?402278-1/bbc-parliament-yearend-review [CSpan] 402278: Downloading webpage ERROR: local variable 'video_type' referenced before assignment Traceback (most recent call last): File "youtube_dl\YoutubeDL.pyo", line 665, in extract_info File "youtube_dl\extractor\common.pyo", line 291, in extract File "youtube_dl\extractor\cspan.pyo", line 78, in _real_extract UnboundLocalError: local variable 'video_type' referenced before assignment
Author
Owner

@jaimeMF commented on GitHub (Dec 28, 2015):

Thanks for the report, it will work in the next version.

@jaimeMF commented on GitHub (Dec 28, 2015): Thanks for the report, it will work in the next version.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#6501
No description provided.