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.
Launching Youtube-dl as a background command #955
Comments
|
Can you elaborate what you mean by "cant terminate"? Also, what do you mean by "fails"? Do you get an error message? It works fine for me: $ youtube-dl http://www.ZZzzzZZ.com &
[1] 9302
$ 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/phihag/projects/youtube-dl/youtube_dl/__main__.py", line 18, in <module>
youtube_dl.main()
File "/home/phihag/projects/youtube-dl/youtube_dl/__init__.py", line 613, in main
_real_main(argv)
File "/home/phihag/projects/youtube-dl/youtube_dl/__init__.py", line 597, in _real_main
retcode = ydl.download(all_urls)
File "/home/phihag/projects/youtube-dl/youtube_dl/YoutubeDL.py", line 567, in download
videos = self.extract_info(url)
File "/home/phihag/projects/youtube-dl/youtube_dl/YoutubeDL.py", line 305, in extract_info
ie_result = ie.extract(url)
File "/home/phihag/projects/youtube-dl/youtube_dl/extractor/common.py", line 91, in extract
return self._real_extract(url)
File "/home/phihag/projects/youtube-dl/youtube_dl/extractor/generic.py", line 95, in _real_extract
new_url = self._test_redirect(url)
File "/home/phihag/projects/youtube-dl/youtube_dl/extractor/generic.py", line 83, in _test_redirect
response = opener.open(HeadRequest(url))
File "/usr/lib/python2.7/urllib2.py", line 410, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 448, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 502: Bad Gateway
[1]+ Exit 1 youtube-dl http://www.ZZzzzZZ.com |
|
@vanilla38 Can you give us some more info so that we can investigate the issue ? It is working for phihag. |
|
I've got (probably) the same problem, using python 2.7 on IRIX. $ ./youtube-dl http://vimeo.com/79695097& [2]+ Stopped ./youtube-dl http://vimeo.com/79695097 However, it continues as normal if I let it run in the foreground again (e.g. with 'fg'), which would be consistent with youtube-dl trying to read stdin. Backgrounding youtube-dl works as well when stdin is redirected from somewhere else: $ ./youtube-dl http://player.vimeo.com/video/79140726/ < /dev/null & [2]+ Done ./youtube-dl http://player.vimeo.com/video/79140726/ < /dev/null The last bits I can see from python -m trace -t par (like strace) continues with the stuff below just after 'fg':
|
|
+1 |
|
The problematic lines lays in ffmpeg: if (tcgetattr (0, &tty) == 0) {
oldtty = tty;
restore_tty = 1;
tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
|INLCR|IGNCR|ICRNL|IXON);
tty.c_oflag |= OPOST;
tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN);
tty.c_cflag &= ~(CSIZE|PARENB);
tty.c_cflag |= CS8;
tty.c_cc[VMIN] = 1;
tty.c_cc[VTIME] = 0;
tcsetattr (0, TCSANOW, &tty);
}(See: https://github.com/FFmpeg/FFmpeg/blob/6f69f7a8bf6a0d013985578df2ef42ee6b1c7994/ffmpeg.c#L371-L385)
This is the case on Linux. Don't know the case in IRIX. I guess there's nothing youtube-dl can do unless we have a patched ffmpeg or a patched Linux kernel, so closing this ticket here. Feel free to propose your solution and I or others will reopen this ticket. |
|
I don't think ffmpeg is involved. youtube-dl stops before even trying to download the video:
|
|
It is. Before the video starts downloading, youtube-dl checks whether ffmpeg/avconv exists or not, and prepend |
|
In IRIX, the problem persists, even if ffmpeg is not in the path. |
|
Could you run the command |
|
stty -tostop doesn't change the behaviour. Python version is 2.7.11. youtube-dl even stops if the video has previously been downloaded completely.
|
|
Well seems the cause is quite different. From your 2013 logs youtube-dl is stopped when calling |
|
Thanks to @johnhawkinson (#10996), this should be fixed in the next version. No more workarounds are necessary. Feel free to open a new issue if there's still something wrong. |
Hi, I just noticed when i try to launch $ youtube-dl http://www.ZZzzzZZ.com &
It fails, program cant terminate.
Any clue ? Thanks.