eliranwong / UniqueBible

A cross-platform bible application, integrated with high-quality resources and amazing features, running offline in Windows, macOS and Linux, ChromeOS, Android, iOS. Various running modes are supported.
https://UniqueBible.app
GNU General Public License v3.0
131 stars 37 forks source link

Youtube downloader is not responding #831

Closed onegladiator4u closed 2 years ago

onegladiator4u commented 2 years ago

Hey bro, i tried to download video using the downloader by clicking MP4 image

UBA is not responding . I checked the video directory . it's looks like a file is downloading and it's taking too much time . i have to end UBA to stop downloading . i also tried downloading via ths + image

image

Same problem

otseng commented 2 years ago

The library we are using has been abandoned.
https://github.com/ytdl-org/youtube-dl

Looking into a replacement...

otseng commented 2 years ago

Replaced youtube-dl with yt-dlp. Give that a try. Only tested on Linux and Mac.

onegladiator4u commented 2 years ago

hi @otseng , i tried it . Now there's no option to download image

otseng commented 2 years ago

Can you try manually installing yt-dlp from: https://github.com/ytdl-org/youtube-dl

onegladiator4u commented 2 years ago

Can you try manually installing yt-dlp from: https://github.com/ytdl-org/youtube-dl

i'll try brother

onegladiator4u commented 2 years ago

i couldn't work it out brother @otseng i placed that exe file in python folder because it is already added in variables . i also installed through pip3 install youtube-dl from unique bible . it was installed but didn't come up in UBA.

otseng commented 2 years ago

Try running the exe file to have it install the driver.

onegladiator4u commented 2 years ago

that exe file didn't install anything . it looks like this image

it doesn't look like an installer

otseng commented 2 years ago

Ah OK.

Are you able to manually run youtube-dl from the command prompt to download a video from Youtube?

otseng commented 2 years ago

Can you also try activating the venv and then running: pip install yt-dlp

onegladiator4u commented 2 years ago

i first did .\venv\Scripts\activate then pip install yt-dlp. is this the correct way ? it showed that it was installed. but nothing changed in the toolbar yet.

otseng commented 2 years ago

Can you see if Python can load it?

Activate venv. Start up python type import yt_dlp

You should see something like this:

(venv) oliver@oliver-Aspire-VN7-791:~/dev/UniqueBible$ python3
Python 3.8.7 (default, Dec 21 2020, 21:23:03) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import yt_dlp
>>> 
onegladiator4u commented 2 years ago

How should I do it ? is it using powershell? i don't know python. can you guide me? i have vscode.

otseng commented 2 years ago

Yes, use powershell.

Activate venv: .\venv\Scripts\activate

Start python: python3

You'll then see python interactive mode message.

Python 3.8.7 (default, Dec 21 2020, 21:23:03) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Type: import yt_dlp

If you see this, then it's not able to find it: Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'yt_dlp'

If you see nothing, then it was able to find it.

Type Ctrl-D to stop the interactive mode.

Here's what the complete steps looks like for me:

oliver@oliver-Aspire-VN7-791:~/dev/UniqueBible$ . ./venv/bin/activate
(venv) oliver@oliver-Aspire-VN7-791:~/dev/UniqueBible$ python3
Python 3.8.7 (default, Dec 21 2020, 21:23:03) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import yt_dlp
>>> 
onegladiator4u commented 2 years ago

Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'yt_dlp'

i got this message

when I tried to run python3 it opened up microsoft store to download python. i installed it.then only i could run import yt_dlp

onegladiator4u commented 2 years ago

bro something else happened after that . i updated python version 39 to python310. i have a new folder for each version of python. i updated using Chocalatey GUI. image

now i'm having errors

image

otseng commented 2 years ago

Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'yt_dlp'

OK. So, something went wrong with the pip install yt-dlp

Can you try uninstalling it and installing it again and copy the results here?

Here's my results:

oliver@oliver-Aspire-VN7-791:~/dev/UniqueBible$ pip uninstall yt-dlp
Found existing installation: yt-dlp 2021.11.10.1
Uninstalling yt-dlp-2021.11.10.1:
  Would remove:
    /home/oliver/.local/bin/yt-dlp
    /home/oliver/.local/lib/python3.9/site-packages/yt_dlp-2021.11.10.1.dist-info/*
    /home/oliver/.local/lib/python3.9/site-packages/yt_dlp/*
    /home/oliver/.local/share/bash-completion/completions/yt-dlp
    /home/oliver/.local/share/doc/yt_dlp/README.txt
    /home/oliver/.local/share/fish/vendor_completions.d/yt-dlp.fish
    /home/oliver/.local/share/man/man1/yt-dlp.1
    /home/oliver/.local/share/zsh/site-functions/_yt-dlp
Proceed (y/n)? y
  Successfully uninstalled yt-dlp-2021.11.10.1
oliver@oliver-Aspire-VN7-791:~/dev/UniqueBible$ pip install yt-dlp
Collecting yt-dlp
  Using cached yt_dlp-2021.11.10.1-py2.py3-none-any.whl (2.4 MB)
Requirement already satisfied: websockets in /home/oliver/.local/lib/python3.9/site-packages (from yt-dlp) (10.0)
Requirement already satisfied: pycryptodomex in /home/oliver/.local/lib/python3.9/site-packages (from yt-dlp) (3.11.0)
Requirement already satisfied: mutagen in /home/oliver/.local/lib/python3.9/site-packages (from yt-dlp) (1.45.1)
Installing collected packages: yt-dlp
Successfully installed yt-dlp-2021.11.10.1
otseng commented 2 years ago

bro something else happened after that . i updated python version 39 to python310.

I haven't upgraded to python 3.10 yet, so it's not supported right now.

onegladiator4u commented 2 years ago

here's what I got . i got errors for both pip and pip3

PS F:\BIBLE STUDY\App\UniqueBible> pip uninstall yt-dlp
Traceback (most recent call last):
  File "c:\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python39\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'
PS F:\BIBLE STUDY\App\UniqueBible> pip3 uninstall yt-dlp
Traceback (most recent call last):
  File "c:\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python39\Scripts\pip3.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'
PS F:\BIBLE STUDY\App\UniqueBible>
onegladiator4u commented 2 years ago

bro something else happened after that . i updated python version 39 to python310.

I haven't upgraded to python 3.10 yet, so it's not supported right now.

ah ok. i uninstalled it. UBA working now

otseng commented 2 years ago

here's what I got . i got errors for both pip and pip3

Looks pip is not installed. Can you install pip and rerun?

onegladiator4u commented 2 years ago

Don't know whether it's installed correctly. i got

PS F:\BIBLE STUDY\App\UniqueBible> pip install yt-dlp
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
Collecting yt-dlp
  Using cached yt_dlp-2021.11.10.1-py2.py3-none-any.whl (2.4 MB)
Requirement already satisfied: websockets in c:\python39\lib\site-packages (from yt-dlp) (10.0)
Requirement already satisfied: mutagen in c:\python39\lib\site-packages (from yt-dlp) (1.45.1)
Requirement already satisfied: pycryptodomex in c:\python39\lib\site-packages (from yt-dlp) (3.11.0)
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
Installing collected packages: yt-dlp
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Python39\\share'
Consider using the `--user` option or check the permissions.

WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
PS F:\BIBLE STUDY\App\UniqueBible>

But Youtube icon is showing . but didn't work . when clicked on the plus icon it showed image

mp3 and mp4 icons opened the respective folders

otseng commented 2 years ago

Did it actually download the video into your video folder?

onegladiator4u commented 2 years ago

Did it actually download the video into your video folder?

no, it didn't . it only opened the folder

otseng commented 2 years ago

Can you try to run these commands from command line?

yt-dlp -x --audio-format mp3 https://www.youtube.com/watch?v=NYhmWIOvebQ

yt-dlp -f bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4 https://www.youtube.com/watch?v=NYhmWIOvebQ
onegladiator4u commented 2 years ago

i got this image

looks like something should be added on PATH don't know what I should add

otseng commented 2 years ago

looks like something should be added on PATH don't know what I should add

Yes, it needs to be added to the path. After you add it, then try rerunning the commands to manually download.

onegladiator4u commented 2 years ago

looks like something should be added on PATH don't know what I should add

Yes, it needs to be added to the path. After you add it, then try rerunning the commands to manually download.

which folder or file should I add? i added F:\BIBLE STUDY\App\UniqueBible\venv\Lib\site-packages\yt_dlp here. is that correct ? image but didn't work .

otseng commented 2 years ago

Can you put the file yt-dlp.exe in the c:\python39 directory? Then run from the command line: yt-dlp -f bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4 https://www.youtube.com/watch?v=NYhmWIOvebQ

onegladiator4u commented 2 years ago

exe file name is different . it is `youtube-dl.ex I renamed it to yt-dlp.exe. now cmd line downloading. it's very slow in downloading UBA was still not responding. it may be because of slow downloading. it finished after a long time . Thanks brother.

otseng commented 2 years ago

https://github.com/yt-dlp/yt-dlp

onegladiator4u commented 2 years ago

Should I update it?

otseng commented 2 years ago

Yes, please, I had posted the wrong url for the new library. It should be: https://github.com/yt-dlp/yt-dlp

The old one was using: https://github.com/ytdl-org/youtube-dl

onegladiator4u commented 2 years ago

Ok brother