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

Downloading does not work #166

Open
manuelkamp opened this issue Oct 4, 2024 · 8 comments
Open

Downloading does not work #166

manuelkamp opened this issue Oct 4, 2024 · 8 comments

Comments

@manuelkamp
Copy link

Describe the bug
Downloading does not work anymore since youtube has changed some things on their side (to prevent alternative frontends and adblockers).

To Reproduce
Steps to reproduce the behavior:
Download any video as you did before

Expected behavior
video downloads

Screenshots
n.a.

Server information
on all methods

Additional context
see invidious or other projects for more details to this major change in youtube.

Oct 04 17:29:31 srv-ytdown python3[6510]: [04-10-2024 17:29] WARNING [YoutubeDL.py:1053]: [youtube] Failed to download m3u8 information: <urllib3.connection.HTTPSConnection obj>
Oct 04 17:29:31 srv-ytdown python3[6510]: [04-10-2024 17:29] DEBUG [YoutubeDL.py:920]: [info] ubHvpMTjH98: Downloading 1 format(s): 18
Oct 04 17:29:31 srv-ytdown python3[6510]: [04-10-2024 17:29] ERROR [YoutubeDL.py:932]: ERROR: unable to download video data: HTTP Error 403: Forbidden
Oct 04 17:29:31 srv-ytdown python3[6510]: [04-10-2024 17:29] ERROR [youtube.py:81]: Downloading error: ERROR: unable to download video data: HTTP Error 403: Forbidden
@JVT038
Copy link
Owner

JVT038 commented Oct 4, 2024

Can you pull the latest version and try again?

@manuelkamp
Copy link
Author

manuelkamp commented Oct 5, 2024

Thank you, pulled latest with recent changes and now this (not working, tried with several different videos):

Oct 05 08:37:38 srv-ytdown python3[6867]: [05-10-2024 08:37] DEBUG [YoutubeDL.py:920]: [youtube] Extracting URL: https://www.youtube.com/watch?v=PWKpXnBxLoE
Oct 05 08:37:38 srv-ytdown python3[6867]: [05-10-2024 08:37] DEBUG [YoutubeDL.py:920]: [youtube] PWKpXnBxLoE: Downloading webpage
Oct 05 08:37:39 srv-ytdown python3[6867]: [05-10-2024 08:37] DEBUG [YoutubeDL.py:920]: [youtube] PWKpXnBxLoE: Downloading ios player API JSON
Oct 05 08:37:39 srv-ytdown python3[6867]: [05-10-2024 08:37] DEBUG [YoutubeDL.py:920]: [youtube] PWKpXnBxLoE: Downloading android player API JSON
Oct 05 08:37:39 srv-ytdown python3[6867]: [05-10-2024 08:37] DEBUG [YoutubeDL.py:920]: [youtube] PWKpXnBxLoE: Downloading player 96d06116
Oct 05 08:37:39 srv-ytdown python3[6867]: [05-10-2024 08:37] WARNING [YoutubeDL.py:1053]: [youtube] PWKpXnBxLoE: nsig extraction failed: You may experience throttling for some formats
Oct 05 08:37:39 srv-ytdown python3[6867]:          n = DGvKl6DOpYlQR4FcnC ; player = https://www.youtube.com/s/player/96d06116/player_ias.vflset/en_US/base.js
Oct 05 08:37:39 srv-ytdown python3[6867]: [05-10-2024 08:37] WARNING [YoutubeDL.py:1053]: [youtube] PWKpXnBxLoE: nsig extraction failed: You may experience throttling for some formats
Oct 05 08:37:39 srv-ytdown python3[6867]:          n = CydNSerqgMM3kd14uc ; player = https://www.youtube.com/s/player/96d06116/player_ias.vflset/en_US/base.js
Oct 05 08:37:39 srv-ytdown python3[6867]: [05-10-2024 08:37] DEBUG [YoutubeDL.py:920]: [youtube] PWKpXnBxLoE: Downloading m3u8 information
Oct 05 08:37:39 srv-ytdown python3[6867]: [05-10-2024 08:37] WARNING [YoutubeDL.py:1053]: [youtube] Failed to download m3u8 information: <urllib3.connection.HTTPSConnection object at 0x71dae60de470>: Failed to establish a new connection: [Errno 22] Invalid argument
Oct 05 08:37:39 srv-ytdown python3[6867]: [05-10-2024 08:37] INFO [sponsorblock.py:7]: Fetching sponsorblock segments for https://www.youtube.com/watch?v=PWKpXnBxLoE
Oct 05 08:37:49 srv-ytdown python3[6867]: Traceback (most recent call last):
Oct 05 08:37:49 srv-ytdown python3[6867]:   File "src/gevent/greenlet.py", line 908, in gevent._gevent_cgreenlet.Greenlet.run
Oct 05 08:37:49 srv-ytdown python3[6867]:   File "/root/metatube/metatube/deezer.py", line 6, in socketsearch
Oct 05 08:37:49 srv-ytdown python3[6867]:     with deezer.Client() as client:
Oct 05 08:37:49 srv-ytdown python3[6867]: AttributeError: __enter__
Oct 05 08:37:49 srv-ytdown python3[6867]: 2024-10-05T06:37:49Z <Thread at 0x71dae5623420: socketsearch({'title': 'EAT FREE FOR A MONTH IF YOU CAN BEAT TH)> failed with AttributeError

@Nemasix
Copy link

Nemasix commented Oct 5, 2024

I had the same error. When I saw Deezer, I tried to use Spotify (by get an api key) and all works. It's a bypass, but it's work ;)

@JVT038
Copy link
Owner

JVT038 commented Oct 5, 2024

Hmm, that's weird, because the deezer metadata provider does work for me.
Which item are you trying to download from YouTube and which item from Deezer are you trying to merge?

@Nemasix
Copy link

Nemasix commented Oct 5, 2024

I try to download You've Got a Friend in Me. The search item in deezer is blocked.

 2024-10-05T15:38:15.423763387Z [05-10-2024 15:38] INFO [youtube.py:51]: Searching YouTube for 'you've got a friend in me'
2024-10-05T15:38:18.389527390Z [05-10-2024 15:38] DEBUG [YoutubeDL.py:939]: [youtube] Extracting URL: https://www.youtube.com/watch?v=0hG-2tQtdlE
2024-10-05T15:38:18.389658584Z [05-10-2024 15:38] DEBUG [YoutubeDL.py:939]: [youtube] 0hG-2tQtdlE: Downloading webpage
2024-10-05T15:38:19.194744984Z [05-10-2024 15:38] DEBUG [YoutubeDL.py:939]: [youtube] 0hG-2tQtdlE: Downloading ios player API JSON
2024-10-05T15:38:19.290440291Z [05-10-2024 15:38] DEBUG [YoutubeDL.py:939]: [youtube] 0hG-2tQtdlE: Downloading web creator player API JSON
2024-10-05T15:38:19.369585550Z [05-10-2024 15:38] DEBUG [YoutubeDL.py:939]: [youtube] 0hG-2tQtdlE: Downloading m3u8 information
2024-10-05T15:38:19.551001347Z [05-10-2024 15:38] INFO [sponsorblock.py:7]: Fetching sponsorblock segments for https://www.youtube.com/watch?v=0hG-2tQtdlE
2024-10-05T15:38:19.596264344Z [05-10-2024 15:38] WARNING [sponsorblock.py:11]: No segments found for https://www.youtube.com/watch?v=0hG-2tQtdlE
2024-10-05T15:38:23.330933395Z Traceback (most recent call last):
2024-10-05T15:38:23.331149574Z   File "src/gevent/greenlet.py", line 908, in gevent._gevent_cgreenlet.Greenlet.run
2024-10-05T15:38:23.331189283Z   File "/config/metatube/deezer.py", line 6, in socketsearch
2024-10-05T15:38:23.331203508Z     with deezer.Client() as client:
2024-10-05T15:38:23.331215198Z          ^^^^^^^^^^^^^^^
2024-10-05T15:38:23.331226368Z TypeError: 'Client' object does not support the context manager protocol
2024-10-05T15:38:23.331343988Z 2024-10-05T15:38:23Z <Thread at 0x7f6394c1af20: socketsearch({'title': "You've Got a Friend in Me", 'artist': ')> failed with TypeError

After settings Spotify, here is the log :

024-10-05T15:45:24.663676882Z [05-10-2024 15:45] INFO [youtube.py:51]: Searching YouTube for 'you've got a friend in me'
2024-10-05T15:45:26.478826526Z [05-10-2024 15:45] DEBUG [YoutubeDL.py:939]: [youtube] Extracting URL: https://www.youtube.com/watch?v=0hG-2tQtdlE
2024-10-05T15:45:26.478952924Z [05-10-2024 15:45] DEBUG [YoutubeDL.py:939]: [youtube] 0hG-2tQtdlE: Downloading webpage
2024-10-05T15:45:27.240454704Z [05-10-2024 15:45] DEBUG [YoutubeDL.py:939]: [youtube] 0hG-2tQtdlE: Downloading ios player API JSON
2024-10-05T15:45:27.329558801Z [05-10-2024 15:45] DEBUG [YoutubeDL.py:939]: [youtube] 0hG-2tQtdlE: Downloading web creator player API JSON
2024-10-05T15:45:28.082703006Z [05-10-2024 15:45] DEBUG [YoutubeDL.py:939]: [youtube] 0hG-2tQtdlE: Downloading m3u8 information
2024-10-05T15:45:28.326738466Z [05-10-2024 15:45] INFO [sponsorblock.py:7]: Fetching sponsorblock segments for https://www.youtube.com/watch?v=0hG-2tQtdlE
2024-10-05T15:45:28.381777760Z [05-10-2024 15:45] WARNING [sponsorblock.py:11]: No segments found for https://www.youtube.com/watch?v=0hG-2tQtdlE
2024-10-05T15:45:31.995080624Z [05-10-2024 15:45] INFO [spotify.py:16]: Searched Spotify for track 'You've Got a Friend in Me' 
2024-10-05T15:45:38.006655308Z [05-10-2024 15:45] INFO [routes.py:132]: Request to download https://www.youtube.com/watch?v=0hG-2tQtdlE
2024-10-05T15:45:38.098803418Z [05-10-2024 15:45] DEBUG [YoutubeDL.py:939]: [youtube] Extracting URL: https://www.youtube.com/watch?v=0hG-2tQtdlE
2024-10-05T15:45:38.098984285Z [05-10-2024 15:45] DEBUG [YoutubeDL.py:939]: [youtube] 0hG-2tQtdlE: Downloading webpage
2024-10-05T15:45:39.246345577Z [05-10-2024 15:45] DEBUG [YoutubeDL.py:939]: [youtube] 0hG-2tQtdlE: Downloading ios player API JSON
2024-10-05T15:45:39.341413642Z [05-10-2024 15:45] DEBUG [YoutubeDL.py:939]: [youtube] 0hG-2tQtdlE: Downloading web creator player API JSON
2024-10-05T15:45:40.126037975Z [05-10-2024 15:45] DEBUG [YoutubeDL.py:939]: [youtube] 0hG-2tQtdlE: Downloading m3u8 information
2024-10-05T15:45:40.305297358Z [05-10-2024 15:45] DEBUG [YoutubeDL.py:939]: [info] 0hG-2tQtdlE: Downloading 1 format(s): 251
2024-10-05T15:45:40.451081965Z [05-10-2024 15:45] DEBUG [YoutubeDL.py:939]: [download] Destination: /downloads/You've Got a Friend in Me.webm
2024-10-05T15:45:40.451779725Z [05-10-2024 15:45] DEBUG [minicurses.py:111]: [download]   0.0% of    2.08MiB at  408.88KiB/s ETA 00:05
2024-10-05T15:45:40.452792725Z [05-10-2024 15:45] DEBUG [minicurses.py:111]: [download]   0.1% of    2.08MiB at  835.46KiB/s ETA 00:02
2024-10-05T15:45:40.453694563Z [05-10-2024 15:45] DEBUG [minicurses.py:111]: [download]   0.3% of    2.08MiB at    1.50MiB/s ETA 00:01
2024-10-05T15:45:40.454689708Z [05-10-2024 15:45] DEBUG [minicurses.py:111]: [download]   0.7% of    2.08MiB at    2.65MiB/s ETA 00:00
2024-10-05T15:45:40.455773233Z [05-10-2024 15:45] DEBUG [minicurses.py:111]: [download]   1.5% of    2.08MiB at    4.60MiB/s ETA 00:00
2024-10-05T15:45:40.470833655Z [05-10-2024 15:45] DEBUG [minicurses.py:111]: [download]   3.0% of    2.08MiB at    2.87MiB/s ETA 00:00
2024-10-05T15:45:40.486178659Z [05-10-2024 15:45] DEBUG [minicurses.py:111]: [download]   6.0% of    2.08MiB at    3.40MiB/s ETA 00:00
2024-10-05T15:45:40.502579984Z [05-10-2024 15:45] DEBUG [minicurses.py:111]: [download]  12.0% of    2.08MiB at    4.71MiB/s ETA 00:00
2024-10-05T15:45:40.517635225Z [05-10-2024 15:45] DEBUG [minicurses.py:111]: [download]  24.0% of    2.08MiB at    7.34MiB/s ETA 00:00
2024-10-05T15:45:40.534543618Z [05-10-2024 15:45] DEBUG [minicurses.py:111]: [download]  48.0% of    2.08MiB at   11.76MiB/s ETA 00:00
2024-10-05T15:45:40.552583107Z [05-10-2024 15:45] DEBUG [minicurses.py:111]: [download]  96.0% of    2.08MiB at   19.36MiB/s ETA 00:00
2024-10-05T15:45:40.554643494Z [05-10-2024 15:45] DEBUG [minicurses.py:111]: [download] 100.0% of    2.08MiB at   19.82MiB/s ETA 00:00
2024-10-05T15:45:40.581222685Z [05-10-2024 15:45] DEBUG [minicurses.py:111]: [download] 100% of    2.08MiB in 00:00:00 at 8.24MiB/s
2024-10-05T15:45:40.814471391Z [05-10-2024 15:45] DEBUG [YoutubeDL.py:939]: [ExtractAudio] Destination: /downloads/You've Got a Friend in Me.mp3
2024-10-05T15:45:44.646535701Z [05-10-2024 15:45] DEBUG [YoutubeDL.py:939]: Deleting original file /downloads/You've Got a Friend in Me.webm (pass -k to keep)
2024-10-05T15:45:44.990485670Z [05-10-2024 15:45] INFO [metadata.py:124]: Getting Spotify metadata
2024-10-05T15:45:45.184621226Z [05-10-2024 15:45] INFO [metadata.py:445]: Finished adding metadata to You've Got a Friend in Me
2024-10-05T15:45:45.201341099Z [05-10-2024 15:45] INFO [database.py:219]: Inserted item You've Got a Friend in Me into database

@manuelkamp
Copy link
Author

manuelkamp commented Oct 5, 2024

I am not sure, it seems this issue thread got hijacked by another different issue by @Nemasix . I do not use Spotify (don't have an account there) or Deezer (don't know what that is). I want to download videos from youtube with MetaTube. None of those I tried works, an example video url I tried is in the log i posted today. You can literally take any Youtube Video URL and download as MP4 (that is my usecase).

@Nemasix
Copy link

Nemasix commented Oct 5, 2024

@manuelkamp If you look how metatube work, he will reach a YouTube file first, and then, go to another platform (deezer by default) to get metadata (look at settings :) )

When you look at your log after pulling the latest version, there is an error on deezer client, that's why I said that ;)

@manuelkamp
Copy link
Author

manuelkamp commented Oct 6, 2024

ok but I do not have a spotify account just to fix that... so is there any way around that? Also I am not sure why spotify is needed for a generic youtube video of a guy eating huge amounts of foods :) I do not want music videos where spotify can provide metadata

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

No branches or pull requests

3 participants