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

Gui cannot download some files that youtube-dl can #49

Closed
Pcsl opened this issue Jul 10, 2015 · 14 comments
Closed

Gui cannot download some files that youtube-dl can #49

Pcsl opened this issue Jul 10, 2015 · 14 comments
Labels

Comments

@Pcsl
Copy link

Pcsl commented Jul 10, 2015

Hello there,

I really like your software and find it very useful but I'm having problems to download some specific links, specifically from the platform this link comes from: http://www.mitele.es/programas-tv/este-hotel-es-un-desastre/temporada-1/programa-1/ . Using the command line interface from youtube-dl the files is download without problems but when I try to download it using your GUI, it got stuck in "Downloading" and doesn't show any speed, ETA, percent nor size. Actually I think that the files doesn't start to download. Apart from that when this happens, the button "STOP" doesn't work and can't close the program, I have to use the task manager to force close it.

I hope you can look into this.

@MrS0m30n3
Copy link
Owner

Hi @Pcsl

Which version of youtube-dlg you are using?

I was unable to download the url you gave me both with the latest version of youtube-dl and youtube-dlg.
The GUI terminates normally with an Error status for the given URL.

You should do the following:

  • Start youtube-dlg
  • Set the -v option under Options > Commands tab
  • Try to re-download the url
  • After download terminates (normally or not) got to Options > Log tab click the View Log button and paste the content of the log here

@Pcsl
Copy link
Author

Pcsl commented Jul 10, 2015

I can download that link with youtube-dl 2015.07.07 without problems (I need ffmpeg in the same folder though).

I tried to add the log here but the problem is that the task never stops, it just get stuck in "Downloading" and never ends so there's no way to view the log as it seems it's saved when the download terminates.

@MrS0m30n3
Copy link
Owner

Can you tell me which version of youtube-dlg you are using?

Does this problem occurs every time you try to download the given url ?
Also, can you run youtube-dl (command-line) with the -v option and paste your output here?

@Pcsl
Copy link
Author

Pcsl commented Jul 12, 2015

I'm using the last version 0.3.8 for Windows (portable). Yeah, that problems occurs every time (I tried more than 10 times).
Here you have the log:

D:>youtube-dl -v http://www.mitele.es/programas
-tv/este-hotel-es-un-desastre/temporada-1/programa-1/
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.mitele.es/programas-tv/este-hote
l-es-un-desastre/temporada-1/programa-1/']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2015.07.07
[debug] Python version 2.7.8 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-71883-geb9fb50
[debug] Proxy map: {}
[mitele.es] programa-1: Downloading webpage
[mitele.es] programa-1: Downloading XML
[mitele.es] programa-1: Downloading JSON metadata
[mitele.es] programa-1: Downloading m3u8 information
[debug] Invoking downloader on u'http://mitele1-vh.akamaihd.net/i/geo/2i/mC/2imC
et301xsyiRFSEV3ab3/Aayo0VkwFejznVJ1XXnDE4.1100,,.mp4.csmil/index_0_av.m3u8?null=
'
[download] Destination: Programa 1 - Gurney_'s Inn - Montauk, NY-875446af.mp4
ffmpeg version N-71883-geb9fb50 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
ble-decklink --enable-zlib
libavutil 54. 23.101 / 54. 23.101
libavcodec 56. 35.101 / 56. 35.101
libavformat 56. 31.100 / 56. 31.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.100 / 5. 16.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, hls,applehttp, from 'http://mitele1-vh.akamaihd.net/i/geo/2i/mC/2imCet
301xsyiRFSEV3ab3/Aayo0VkwFejznVJ1XXnDE4.1100,,.mp4.csmil/index_0_av.m3u8?null=':

Duration: 00:42:34.00, start: 0.100511, bitrate: 0 kb/s
Program 0
Metadata:
variant_bitrate : 0
Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv), 720x4
04 [SAR 1021:1024 DAR 45945:25856], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, flt
p, 88 kb/s
Stream #0:2: Data: timed_id3 (ID3 / 0x20334449)
[mp4 @ 056fcb00] Codec for stream 0 does not use global headers but container fo
rmat requires global headers
[mp4 @ 056fcb00] Codec for stream 1 does not use global headers but container fo
rmat requires global headers
Output #0, mp4, to 'Programa 1 - Gurney_'s Inn - Montauk, NY-875446af.mp4.part':

Metadata:
encoder : Lavf56.31.100
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 720x404 [SAR 102
1:1024 DAR 45945:25856], q=2-31, 25 fps, 25 tbr, 90k tbn, 90k tbc
Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 88 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 261 fps=0.0 q=-1.0 size= 1523kB time=00:00:10.42 bitrate=1196.5kbits/
frame= 501 fps=477 q=-1.0 size= 2933kB time=00:00:20.01 bitrate=1200.6kbits/

@MrS0m30n3
Copy link
Owner

The gui does not provide any info about the size, eta, download speed etc. because those informations are not available neither on the youtube-dl.

Now for the second issue with the stop button, i was able to reproduce it using a proxy.
The gui hangs both on Windows and Linux when the stop button is pressed. This issue does not only apply in the mitele.es but on every site that uses the hls.py downloader.

Also, the download process never stops both on Windows and Linux.

I will take a closer look on this.

@Pcsl
Copy link
Author

Pcsl commented Jul 13, 2015

Thanks for your work!
Apart from that, did you find out why the download works with my youtube-dl version but not with youtube-dl-gui¿

@MrS0m30n3
Copy link
Owner

There were two different bugs.

Both bugs had more or less to do with the hls downloader and the usage of ffmpeg
(more specifically with this line of code).

The first bug was that the subprocess module was deadlocking due to the large amount of ffmpeg output in the stderr pipe which had as a result to freeze the download process (this issue is now fixed both on Windows and Linux using a seperate thread to read from the stderr pipe).

The second bug was that currently there is no way to kill the whole process group using the subprocess module (see: https://bugs.python.org/issue5115). So basically the stop button kills only the youtube-dl process which leaves ffmpeg process as an orphan, which in turn makes youtube-dlg to wait for the completion of the ffmpeg process before it closes down itself. (If you use something like Process Explorer and pay attention to what is happening when you click the stop button you will get what i mean).

This issue is now fixed on Linux using the os.killpg function. On Windows there is no easy way to terminate the whole process group using the subprocess module, so the stop button won't work when the hls downloader is used. In order to overcome this issue on Windows you can use the native hls downloader (does not use ffmpeg) by setting the --hls-prefer-native option under Options > Commands tab.

I uploaded the patched version (it's not stable) here. I was able to successfully download your url using the patched version and by setting the --hls-prefer-native option.

Can you give it a try and let me know?

@MrS0m30n3
Copy link
Owner

Μore generally, you should be able to download any url that uses the hls downloader without setting the --hls-prefer-native option under Options > Commands , but on Windows the stop button won't work unless you set it or until this issue is fixed.

Notes

  • The native hls downloader won't work on every site.
  • The native hls downloader provides the percentage as download info, unlike the normal hls downloader which does not provide any info about the download process.

@Pcsl
Copy link
Author

Pcsl commented Jul 15, 2015

First of all I tried to download using the patched version without setting the --hls-prefer-native option. The download works now and shows 100% when it's finished, however the status says "Error". Anyway it's completed successfully, it's just that it says "Error" on the GUI. The Stop button doesn't finish the task here.

Setting --hls-prefer-native works flawlessly, shows the percentage completed while it's downloading and the task it's completed succesfully too. It also shows "Error" at the Status column even if it were downloaded completely. Here there is no problem to stop the task.

So yeah, it seems everything is working as you described.

@MrS0m30n3
Copy link
Owner

Everything seems fine except the Error status.

You should check your log under Options > Log tab. Also, check if you have set the -v option under Options > Commands which creates the debug output to the log file. If you have the -v option remove it and give it another try.

@Pcsl
Copy link
Author

Pcsl commented Jul 16, 2015

Yeah, you are right, if I remove the -v option the status is right, it just says "Finished". So it seems to be working fine now.

@MrS0m30n3
Copy link
Owner

Thanks for your report.
If you encounter any problems, feel free to open a new issue.

@Hrxn
Copy link

Hrxn commented Jul 19, 2015

Good job, great work!
👍

(Just a little bit of encouragement)
😄

@MrS0m30n3
Copy link
Owner

Thank you @Hrxn 👊

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

No branches or pull requests

3 participants