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

Youtube-dl can't connect suddenly even though same video plays on browser #13203

Open
iripu opened this issue May 25, 2017 · 2 comments
Open

Youtube-dl can't connect suddenly even though same video plays on browser #13203

iripu opened this issue May 25, 2017 · 2 comments

Comments

@iripu
Copy link

@iripu iripu commented May 25, 2017

Make sure you are using the latest version:

  • I've verified and I assure that I'm running youtube-dl 2017.05.23

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

E:\The Essential Web Developer Course (Free)>youtube-dl -v -n --download-archive archive.txt -
-playlist-start 97 -f hd_mp4_video-0/hd_mp4_video -o "E:\%(playlist)s\%(playlist_index)s-%(tit
le)s-%(height)sp.%(ext)s" http://upskillcourses.com/courses/enrolled/119763
[debug] System config: []
[debug] User config: ['-f', '242+250/242+171/bestvideo[height<=240]+bestaudio[ext=m4a]/best[height<=240]', '--no-mtime',
 '--console-title', '-o', 'c:\\$HOMEPATH\\Desktop\\%(title)s-%(height)sp.%(ext)s']
[debug] Custom config: []
[debug] Command-line args: ['-v', '-n', '--download-archive', 'archive.txt', '--playlist-start', '97', '-f', 'hd_mp4_vid
eo-0/hd_mp4_video', '-o', 'E:\\%(playlist)s\\%(playlist_index)s-%(title)s-%(height)sp.%(ext)
s', 'http://upskillcourses.com/courses/enrolled/119763']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2017.05.23
[debug] Python version 3.4.4 - Windows-8.1-6.3.9600
[debug] exe versions: ffmpeg N-84348-gdb7a05d, ffprobe N-84348-gdb7a05d
[debug] Proxy map: {}
[UpskillCourse] Downloading login page
[UpskillCourse] Logging in
[UpskillCourse] 119763: Downloading webpage
[download] Downloading playlist: The Essential Web Developer Course (Free)
[UpskillCourse] playlist The Essential Web Developer Course (Free): Collected 192 video ids (downloading 96 of them)
[download] Downloading video 1 of 96
[Upskill] Downloading login page
[Upskill] Logging in
[Upskill] 1747068: Downloading webpage
[Wistia] 7oouizeib1: Downloading JSON metadata
[download] 52. Contacts Table has already been recorded in archive
[download] Downloading video 2 of 96
[Upskill] 1747069: Downloading webpage
[Wistia] jt2pr02152: Downloading JSON metadata
[download] 53. Explanation of Contacts Table and Migration has already been recorded in archive
[download] Downloading video 3 of 96
[Upskill] 1747070: Downloading webpage
[Wistia] si7gtwjjy5: Downloading JSON metadata
[download] 54. Contact Model File has already been recorded in archive
[download] Downloading video 4 of 96
[Upskill] 1747071: Downloading webpage
[Wistia] rb6n6qq685: Downloading JSON metadata
[debug] Invoking downloader on 'http://embed.wistia.com/deliveries/3dd36c9d45fd540c095cac5534ad2a29488bd5ed.bin'
[download] Resuming download at byte 13019370
[download] Destination: E:\The Essential Web Developer Course (Free)\100-55. Explanation of Mo
del Files-720p.mp4
[download] 100% of 24.21MiB in 00:30
[download] Downloading video 5 of 96
[Upskill] 1747072: Downloading webpage
[Wistia] honyfu4xlu: Downloading JSON metadata
[debug] Invoking downloader on 'http://embed.wistia.com/deliveries/a6a233eda90745a278267c5fe3f4f7d64ca32603.bin'
[download] Destination: E:\The Essential Web Developer Course (Free)\101-56. Contact Create Ac
tion for Saving to the Database-720p.mp4
[download]  83.6% of 24.42MiB at 283.64KiB/s ETA 00:14
E:\The Essential Web Developer Course (Free)>youtube-dl -v -n --download-archive archive.txt -
-playlist-items 1-87 -f hd_mp4_video-0/hd_mp4_video http://upskillcourses.com/courses/enrolled/119763
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-n', '--download-archive', 'archive.txt', '--playlist-items', '1-87', '-f', 'hd_mp4_v
ideo-0/hd_mp4_video', 'http://upskillcourses.com/courses/enrolled/119763']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2017.05.23
[debug] Python version 3.4.4 - Windows-8.1-6.3.9600
[debug] exe versions: ffmpeg N-84348-gdb7a05d, ffprobe N-84348-gdb7a05d
[debug] Proxy map: {}
[UpskillCourse] Downloading login page
[UpskillCourse] Logging in
ERROR: Unable to download webpage: <urlopen error [WinError 10053] An established connection was aborted by the software
 in your host machine> (caused by URLError(ConnectionAbortedError(10053, 'An established connection was aborted by the s
oftware in your host machine', None, 10053, None),))
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpt2mgl7d6\build\youtube_dl\extractor\common.py", lin
e 502, in _request_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpt2mgl7d6\build\youtube_dl\YoutubeDL.py", line 2106,
 in urlopen
  File "C:\Python\Python34\lib\urllib\request.py", line 464, in open
  File "C:\Python\Python34\lib\urllib\request.py", line 482, in _open
  File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpt2mgl7d6\build\youtube_dl\utils.py", line 1090, in
https_open
  File "C:\Python\Python34\lib\urllib\request.py", line 1185, in do_open

Description of your issue, suggested solution and other information

The 1st verbose output above, it's downloading a playlist. It stopped at certain percentage and stayed there for several minutes. I had to close the cmd window. Now, if I open the playlist page on my browser it opens. Then I close the browser tab, open cmd and start downloading the same playlist, it continues. After sometime again it stops.

The 2nd verbose output it shows en error and stopped. This happens on youtube videos too. On Youtube video the error shows:

ERROR: unable to download video info webpage: <urlopen error [WinError 10051] 
A socket operation was attempted to an unreachable network> 
(caused by URLError(OSError(10051, 'A socket operation was attempted to an unreachable 
network', None, 10051, None),))

If I enter the same command in another window of cmd, the it can't download. So, I do this:
Open the video/playlist link in Firefox, close it. Open a new cmd window and start downloading again. It then works.

I'm not sure if these 2/3 isssues are same or different. I also don't know if the issue is with my connection or youtube-dl. My point is, my internet still works and I can watch the same video on my browser. But, youtube-dl suddenly stops downloading and can't connect.

Another thing: Example on Readme.md still has C:%HOMEPATH% and two %% C:\%HOMEPATH%\Desktop\%%(title)s.%%(ext)s. I think you should update that to toC:\$HOMEPATH\Desktop\%(title)s.%(ext)s

@iripu iripu changed the title Youtube-dl can't connect suddenly even though I can watch the same video on browser Youtube-dl can't connect suddenly even though same video plays on browser May 25, 2017
@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 25, 2017

Most likely there is a problem with you network connection. Post the output with --print-traffic.

@LesterCovax
Copy link

@LesterCovax LesterCovax commented Jan 11, 2020

Apologies for issue necro, but since I found this years later, someone else may find it useful...

I was just experiencing this issue, and removing -6 (force IPv6) from my config fixed the issue. Also, --print-traffic and -v don't provide any additional info in this scenario. There's something wonky with this particular machine (probably related to a bridged network adapter for hyper-v), as I tested IPv6 connectivity on another box at home and had no issues.
You can quickly test your IPv6 connectivity here, BTW: https://ipv6-test.com/

# Some other tests to run (examples use powershell but can substitute ping/nslookup)

Resolve-DnsName -Name youtube.com -Type AAAA # DNS lookup IPv6
Resolve-DnsName -Name youtube.com -Type A # DNS lookup IPv4
Test-Connection -TargetName youtube.com -IPv6 # Ping IPv6 (or use IPv6 address)
Test-Connection -TargetName youtube.com -IPv4 # Ping IPv4 (or use IPv4 address)

# Easy fix to try is flushing your DNS cache

ipconfig /flushdns

So, I won't go into troubleshooting IPv6 connectivity, but maybe try adding the -4 flag to force IPv4 usage if you're having issues.

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.

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