MrS0m30n3 / youtube-dl-gui

A cross platform front-end GUI of the popular youtube-dl written in wxPython.
The Unlicense
9.3k stars 1.59k forks source link

Bad youtube-dl binary causes youtube-dl-gui to crash + unexpected behaviour #244

Closed jerry011235 closed 6 years ago

jerry011235 commented 7 years ago

youtube-dl-gui-0.4-win-portable.zip win 10 64bit Build 15063 test url : http://v.youku.com/v_show/id_XMzE2NzkzMjY3Mg==.html (youku: 优酷 is in youtube-dl supported sites ) cmd gif youtube-dl-gui.exe.log:

Exception in thread Thread-2:
Traceback (most recent call last):
  File "threading.pyc", line 801, in __bootstrap_inner
  File "youtube_dl_gui\downloadmanager.pyc", line 599, in run
  File "youtube_dl_gui\downloaders.pyc", line 162, in download
  File "youtube_dl_gui\downloaders.pyc", line 337, in _create_process
  File "subprocess.pyc", line 390, in __init__
  File "subprocess.pyc", line 640, in _execute_child
WindowsError: [Error 193] %1 不是有效的 Win32

the last word means: WindowsError: [Error 193] %1 It is not a valid Win32 and sometimes when youtube-dl download failed(time out or other bugs), click the delete icon ,hint "can't remove",then click the "X" icon,The window is not responding.this is hard to reproduce,so I can't capture.

MrS0m30n3 commented 6 years ago

Thats 100% due to some error in the youtube-dl executable (probably bad update).

The easiest way to fix this, is to update youtube-dl. Nevertheless i uploaded a new patched portable version that handles the above case and exits normally. You can find it here.

Let me know if the patched version works for you.

Now, regarding the second issue:

and sometimes when youtube-dl download failed(time out or other bugs), click the delete icon ,hint "can't remove",then click the "X" icon,The window is not responding.this is hard to reproduce,so I can't capture.

Do you get the same log output (WindowsError: [Error 193] %1 It is not a valid Win32)?

jerry011235 commented 6 years ago

1.unfortunately,the patched version doesn't works for me. log:

Exception in thread Thread-2:
Traceback (most recent call last):
  File "threading.pyc", line 801, in __bootstrap_inner
  File "youtube_dl_gui\downloadmanager.pyc", line 599, in run
  File "youtube_dl_gui\downloaders.pyc", line 162, in download
  File "youtube_dl_gui\downloaders.pyc", line 353, in _create_process
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb2 in position 15: ordinal not in range(128)

2.It's most likely bad update. because I do it as below: open the patched youtube-dl-gui.exe,"setting"---"update",After a long time and it's no response,then I click the "X" icon,The window is not responding.and this don't generate log. bug

MrS0m30n3 commented 6 years ago
  1. Thats a different issue, try this portable build.
  2. You should wait for the update to complete, if you close the program like that it will result in a corrupted youtube-dl binary (that's the reason it asks you to force the shutdown). I also changed the update timeout to 10 seconds (see 7501118fcb0d985171e20c85f94dcd1800636f80) which should terminate the update process automatically if it takes too long.

Let me know if the new patched version works.

jerry011235 commented 6 years ago

1.it shows "Downloads completed" in one second,and show "Successfully downloaded 0 url ( ) in 0 day ( s ) hour ( s ) minute ( s ) second" ,but actually It's not downloaded.

Traceback (most recent call last):
  File "youtube_dl_gui\optionsframe.pyc", line 119, in _on_reset
  File "youtube_dl_gui\optionsframe.pyc", line 125, in reset
  File "youtube_dl_gui\optionsframe.pyc", line 130, in load_all_options
  File "youtube_dl_gui\optionsframe.pyc", line 432, in load_options
KeyError: u'zh_CN'

2.,It take a long time for downloading latest youtube-dl(over 300 seconds),finally it shows "youtube - dl download failed ( the read operation timed out , ]" so I want to ask about proxy: setting---options---advanced---network---proxy a.Is it correct format? snipaste_20171210_232315 b.we know after setting the proxy,when downloading videos will use it,but Will it be used when downloading latest youtube-dl in youtube-dl-gui?

MrS0m30n3 commented 6 years ago
  1. Thats actually normal since the youtube-dl binary is corrupted, but now the download status of the item should be set to Error and you should also have a message in your log file stating what went wrong.

  2. Thats normal if you experience issues with your connection. a. Yes, the proxy is correct. b. The proxy is only used when downloading videos and NOT during the update phase.

  3. The new traceback Traceb... KeyError: u'zh_CN' it's a new issue that has nothing to do with the current one. It is related to commit c4b012d2c83104a119faaf36c6890b681b423aad and should be now fixed. Check this version.

I believe thats a new record of patches for a single issue 😄. If you find anything else just post here, hope everything works fine now.

jerry011235 commented 6 years ago

"setting"---"update", this patched version Successfully shows “Successfully downloaded youtube - dl”. but still can't download videos. the log:

D:\Greenapps\youtube-dl-gui-win-portable\library.zip\youtube_dl_gui\downloaders.py:59: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
MrS0m30n3 commented 6 years ago

The new log message is again a completely different issue. You can download the latest build from here (this should get rid of that log message).

this patched version Successfully shows “Successfully downloaded youtube-dl” but still can't download videos.

You should follow the instructions below (this will tell as what went wrong with youtube-dl):

  1. Restart youtube-dl-gui
  2. Go to Options > Extra tab
  3. Enable Debug youtube-dl
  4. Go to Options > Advanced tab and Clear your log contents
  5. Try to download your URL
  6. Get your log contents (Settings -> View Log) and paste them here

Note, if you get any log messages while closing youtube-dl-gui paste them also here.

jerry011235 commented 6 years ago

Everything's ok!Great!Perfect solution! Give a song to you as a present. another song. It's good, too. Best Regards!

jerry011235 commented 6 years ago

BTW,I want to use the proxy during update phase because sometimes I couldn't visit github. maybe this is a new feature,hope to add to the TODO list.

MrS0m30n3 commented 6 years ago

You managed to download the video with no errors? Just asking because you didn't send the log file.

About the proxy idea during the update phase. Lots of bad things can happen if you download an *.exe file through an untrusted proxy. Anyway i will add it in the TODO list, maybe in the feature if we implement some kind of integrity check, then we could also add the update proxy.

For now if you have problems updating youtube-dl you can follow one of the two ways below:

Manually download & update youtube-dl (easy)

  1. Download youtube-dl.exe from here: https://yt-dl.org/downloads/latest/youtube-dl.exe
  2. Copy youtube-dl.exe to %appdata%\youtube-dlg\

Use the existing youtube-dl copy (harder)

  1. Open your settings file (a simple text editor is sufficient): %appdata%\youtube-dlg\settings.json
  2. Edit the youtubedl_path value to point at the youtube-dl exe (in your case should be D:\Greenapps\youtube-dl)

You can also read issues #11 and #28 which are relevant. If you have any questions just let me know.

Also, thanks for the songs! 🎵 🎧

jerry011235 commented 6 years ago

You managed to download the video with no errors? YES! No errors,Everything's fine! Thank you for your advice about updating youtube-dl.If I have some problem someday I will follow it. and you can close the issue.😄

MrS0m30n3 commented 6 years ago

Thank you for your patience, if you find anything else just open a new issue.