Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
"local variable 'err' referenced before assignment" in /downloader/http.py#L133 #15305
Comments
|
Nothing is wrong in your log. The video is unavailable due to server side 503 error that is clearly stated in the log.
This is not possible in the original code since |
|
Did you try it? It crashes out of Python... The error was reported against your .EXE build, nothing to do with my private build. |
|
I'd assume that an exception and crash should never happen, regardless of the 503 error.
As you can see from the filename, it's an exception in the embedded Python from your released build. |
|
@dstftw For example, if I were using |
|
Again: nothing crashed. You are using verbose output that prints out a traceback. |
In the output below, nevermind the
HTTP 503errors, but note the crash right afterwards.This is with the pre-built Windows exe of youtube-dl version 2018.01.14, using the command as shown:
C:\>youtube-dl.exe -v -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]" https://www.youtube.com/watch?v=hwpChyWCUaw [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['-v', '-f', 'bestvideo[ext=mp4]+bestaudio[ext=m4a]', 'https://www.youtube.com/watch?v=hwpChyWCUaw'] [debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252 [debug] youtube-dl version 2018.01.14 [debug] Python version 3.4.4 (CPython) - Windows-10-10.0.16299 [debug] exe versions: none [debug] Proxy map: {} [youtube] hwpChyWCUaw: Downloading webpage [youtube] hwpChyWCUaw: Downloading video info webpage [youtube] hwpChyWCUaw: Extracting video information WARNING: You have requested multiple formats but ffmpeg or avconv are not installed. The formats won't be merged. [debug] Invoking downloader on 'https://r3---sn-nx5e6ne6.googlevideo.com/videoplayback? keepalive=yes requiressl=yes ipbits=0 sparams=aitags,clen,dur,ei,gir,id,initcwndbps,ip,ipbits,itag,keepalive,lmt,mime,mm,mn,ms,mv,pl,requiressl,source,expire ms=au mv=m source=youtube lmt=1444727072053666 ip=■.■.■.■ key=yt6 expire=1516288332 id=o-ACmhCn5_22MehSMROOpe5aNt0MqGbxzzCw532bVMgW-C dur=163.133 mn=sn-nx5e6ne6 mm=31 gir=yes itag=137 clen=76469870 ei=7GRgWvHrMZeY-QPSobTYDA pl=16 mt=1516266635 beids=[9466591] initcwndbps=1463750 aitags=133,134,135,136,137,160,242,243,244,247,248,278 mime=video/mp4 signature=DF872E89C2925B72C83DAC6253EF55FB630C6C70.211ACDCFC7F24F3ACF6FB5A5DF6B908711C6F137 ratebypass=yes' [download] Got server HTTP error: HTTP Error 503: Service Unavailable. Retrying (attempt 1 of 10)... [download] Got server HTTP error: HTTP Error 503: Service Unavailable. Retrying (attempt 2 of 10)... [download] Got server HTTP error: HTTP Error 503: Service Unavailable. Retrying (attempt 3 of 10)... [download] Got server HTTP error: HTTP Error 503: Service Unavailable. Retrying (attempt 4 of 10)... [download] Got server HTTP error: HTTP Error 503: Service Unavailable. Retrying (attempt 5 of 10)... [download] Got server HTTP error: HTTP Error 503: Service Unavailable. Retrying (attempt 6 of 10)... [download] Got server HTTP error: HTTP Error 503: Service Unavailable. Retrying (attempt 7 of 10)... [download] Got server HTTP error: HTTP Error 503: Service Unavailable. Retrying (attempt 8 of 10)... [download] Got server HTTP error: HTTP Error 503: Service Unavailable. Retrying (attempt 9 of 10)... [download] Got server HTTP error: HTTP Error 503: Service Unavailable. Retrying (attempt 10 of 10)... ERROR: giving up after 10 retries File "__main__.py", line 19, in File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpo17hktrm\build\youtube_dl\__init__.py", line 465, in main File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpo17hktrm\build\youtube_dl\__init__.py", line 455, in _real_main File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpo17hktrm\build\youtube_dl\YoutubeDL.py", line 1988, in download File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpo17hktrm\build\youtube_dl\YoutubeDL.py", line 795, in extract_info File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpo17hktrm\build\youtube_dl\YoutubeDL.py", line 849, in process_ie_result File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpo17hktrm\build\youtube_dl\YoutubeDL.py", line 1622, in process_video_result File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpo17hktrm\build\youtube_dl\YoutubeDL.py", line 1889, in process_info File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpo17hktrm\build\youtube_dl\YoutubeDL.py", line 1834, in dl File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpo17hktrm\build\youtube_dl\downloader\common.py", line 361, in download File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpo17hktrm\build\youtube_dl\downloader\http.py", line 296, in real_download File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpo17hktrm\build\youtube_dl\downloader\common.py", line 163, in report_error File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpo17hktrm\build\youtube_dl\YoutubeDL.py", line 612, in report_error File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpo17hktrm\build\youtube_dl\YoutubeDL.py", line 574, in trouble C:\>As I mentioned above (and as you can see), the above output is using your latest official Windows release, but based on a separate private branch I have, I tracked the problem a little more, and I believe the actual error might be:
UnboundLocalError: local variable 'err' referenced before assignment
and it might be happening at...
https://github.com/rg3/youtube-dl/blob/master/youtube_dl/downloader/http.py#L133
I apologize in advance if that additional information is not correct and leads you astray. If that is the case, please feel free to change the title of the issue accordingly.