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

youtube-dl: fix downloads from youtube. #126066

Closed
wants to merge 1 commit into from
Closed

youtube-dl: fix downloads from youtube. #126066

wants to merge 1 commit into from

Conversation

MikeMcQuaid
Copy link
Member

It's good that we have a --HEAD here but, given that this software is useless at its named purpose without this patch: let's just patch it please.

Anticipating some push-back here:

  • it's silly for us to have a formula like this that doesn't work at its named purpose but can be fixed so trivially just for our "avoid patching" rules (rules which I came up with, incidentally 😅)
  • the project is updated regularly but hasn't been tagged for several years: New Release? ytdl-org/youtube-dl#31585. I've asked them for a tag in that issue but, if that doesn't happen, we should consider removing this formula or moving to a better maintained/tagged fork
  • in general, if we're finding ourselves adding --HEAD just for a bug as showstopper as this: we should be considering making our own "tag" to get users tided over until us and upstream figure something better out

It's good that we have a `--HEAD` here but, given that this software is
useless at its named purpose without this patch: let's just patch it
please.
@BrewTestBot BrewTestBot added the python Python use is a significant feature of the PR or issue label Mar 18, 2023
@chenrui333
Copy link
Member

LGTM.

@Porkepix
Copy link
Contributor

For a fork with regular releases, there's https://github.com/yt-dlp/yt-dlp already present in Homebrew.

@BrewTestBot
Copy link
Member

🤖 A scheduled task has triggered a merge.

@chenrui333
Copy link
Member

For a fork with regular releases, there's https://github.com/yt-dlp/yt-dlp already present in Homebrew.

yeah, they are fully aware of the forks, you can see the discussions in ytdl-org/youtube-dl#31530

@MikeMcQuaid
Copy link
Member Author

Thanks @chenrui333!

@arisolt
Copy link

arisolt commented Mar 30, 2023

is the recommended solution currently to install yt-dlp instead? in the original youtube-dl megathread it is mentioned that "brew can now update you to a patched version"; however, when running brew upgrade youtube-dl, I'm told: youtube-dl 2021.12.17 already installed.

@MikeMcQuaid
Copy link
Member Author

@arisolt do brew reinstall youtube-dl to pick up these changes. We could also confider a revision bump here.

@tom-zosh
Copy link

@MikeMcQuaid I just did a brew reinstall youtube-dl and the problem still persists. I still get the error. Anything else that I can try?

@gromgit
Copy link
Member

gromgit commented Mar 31, 2023

@tom-zosh Post the exact youtube-dl command you tried, and its output. Summarizing what you see with "problem still persists" makes it impossible for anyone to help.

@tom-zosh
Copy link

@MikeMcQuaid @gromgit OK, here's the exact youtube-dl command I tried, and its output:

tom@Toms-Mac-Studio ~ % youtube-dl -x "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
[youtube] dQw4w9WgXcQ: Downloading webpage
WARNING: unable to extract uploader id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
[download] Destination: Rick Astley - Never Gonna Give You Up (Official Music Video)-dQw4w9WgXcQ.webm
[download] 100% of 3.28MiB in 01:13
[ffmpeg] Destination: Rick Astley - Never Gonna Give You Up (Official Music Video)-dQw4w9WgXcQ.opus
Deleting original file Rick Astley - Never Gonna Give You Up (Official Music Video)-dQw4w9WgXcQ.webm (pass -k to keep)

tom@Toms-Mac-Studio ~ % brew reinstall youtube-dl
==> Fetching youtube-dl
==> Downloading https://ghcr.io/v2/homebrew/core/youtube-dl/manifests/2021.12.17-2
Already downloaded: /Users/tom/Library/Caches/Homebrew/downloads/af4e009121ff7543121df7c09854a632e93503182cf834b087ae0a5c76d6c62d--youtube-dl-2021.12.17-2.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/youtube-dl/blobs/sha256:1785d927f08c742e1a5be3b7e78720b9b59ecbf0629097fbd3ac5f38f4
Already downloaded: /Users/tom/Library/Caches/Homebrew/downloads/ccb915ea24581bba9844d03ed11173ef62346d1d436c136e84466ccb2104df69--youtube-dl--2021.12.17.arm64_ventura.bottle.2.tar.gz
==> Reinstalling youtube-dl 
==> Pouring youtube-dl--2021.12.17.arm64_ventura.bottle.2.tar.gz
🍺  /opt/homebrew/Cellar/youtube-dl/2021.12.17: 1,596 files, 16.3MB
==> Running `brew cleanup youtube-dl`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

tom@Toms-Mac-Studio ~ % youtube-dl -x "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
[youtube] dQw4w9WgXcQ: Downloading webpage
WARNING: unable to extract uploader id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
[download] Destination: Rick Astley - Never Gonna Give You Up (Official Music Video)-dQw4w9WgXcQ.webm
[download] 100% of 3.28MiB in 01:13
[ffmpeg] Destination: Rick Astley - Never Gonna Give You Up (Official Music Video)-dQw4w9WgXcQ.opus
Deleting original file Rick Astley - Never Gonna Give You Up (Official Music Video)-dQw4w9WgXcQ.webm (pass -k to keep)

tom@Toms-Mac-Studio ~ % brew list youtube-dl     
/opt/homebrew/Cellar/youtube-dl/2021.12.17/bin/youtube-dl
/opt/homebrew/Cellar/youtube-dl/2021.12.17/etc/bash_completion.d/youtube-dl.bash-completion
/opt/homebrew/Cellar/youtube-dl/2021.12.17/libexec/bin/ (11 files)
/opt/homebrew/Cellar/youtube-dl/2021.12.17/libexec/lib/ (2387 files)
/opt/homebrew/Cellar/youtube-dl/2021.12.17/libexec/share/ (2 files)
/opt/homebrew/Cellar/youtube-dl/2021.12.17/libexec/pyvenv.cfg
/opt/homebrew/Cellar/youtube-dl/2021.12.17/share/fish/vendor_completions.d/youtube-dl.fish
/opt/homebrew/Cellar/youtube-dl/2021.12.17/share/man/man1/youtube-dl.1
tom@Toms-Mac-Studio ~ % 

@gromgit
Copy link
Member

gromgit commented Mar 31, 2023

It's functioning as expected: the inability to extract uploader id used to be an error (which stops downloads cold), and this patch downgrades it to a warning (which allows the download to proceed).

@tom-zosh
Copy link

@gromgit OK, gotcha. I thought that the uploader id issue was resolved entirely, not just changed from a ERROR to a WARNING. Thanks for the clarification.

@ltgs
Copy link

ltgs commented Apr 20, 2023

@tom-zosh @gromgit

Strange... I did exactly what Tom did and I'm still getting the error (not the warning).

Interestingly, when I list my youtube-dl install, I'm noticing that my lib folder contains less files than Tom's lib folder:

mac@iMac27 ~ % brew list youtube-dl
/usr/local/Cellar/youtube-dl/2021.12.17/bin/youtube-dl
/usr/local/Cellar/youtube-dl/2021.12.17/etc/bash_completion.d/youtube-dl.bash-completion
/usr/local/Cellar/youtube-dl/2021.12.17/libexec/bin/ (11 files)
/usr/local/Cellar/youtube-dl/2021.12.17/libexec/lib/ (1571 files)
/usr/local/Cellar/youtube-dl/2021.12.17/libexec/share/ (2 files)
/usr/local/Cellar/youtube-dl/2021.12.17/libexec/pyvenv.cfg
/usr/local/Cellar/youtube-dl/2021.12.17/share/fish/vendor_completions.d/youtube-dl.fish
/usr/local/Cellar/youtube-dl/2021.12.17/share/man/man1/youtube-dl.1

Could that have something to do with it? I've reinstalled an upgraded many times. Still get the error. Any other commands I could try? How would I completely wipe my current install and do a fresh brew install (not a reinstall)?

@gromgit
Copy link
Member

gromgit commented Apr 21, 2023

@ltgs What's the output of:

brew info youtube-dl
which -a youtube-dl

?

@ltgs
Copy link

ltgs commented Apr 21, 2023

brew info youtube-dl

mac@iMac27 ~ % brew info youtube-dl
==> youtube-dl: stable 2021.12.17 (bottled), HEAD
Download YouTube videos from the command-line
https://youtube-dl.org/
/usr/local/Cellar/youtube-dl/2021.12.17 (2,412 files, 22.7MB) *
Poured from bottle using the formulae.brew.sh API on 2023-04-20 at 15:16:16
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/youtube-dl.rb
License: Unlicense
==> Dependencies
Required: python@3.11 ✔
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 565 (30 days), 13,934 (90 days), 133,878 (365 days)
install-on-request: 550 (30 days), 13,803 (90 days), 132,356 (365 days)
build-error: 0 (30 days)

mac@iMac27 ~ % which -a youtube-dl
/usr/local/bin/youtube-dl

@gromgit
Copy link
Member

gromgit commented Apr 21, 2023

And what's the output of grep -Er "uploader_id.*fatal=False" $(brew --prefix youtube-dl)?

@ltgs
Copy link

ltgs commented Apr 21, 2023

mac@iMac27 ~ % grep -Er "uploader_id.*fatal=False" $(brew --prefix youtube-dl)
/usr/local/opt/youtube-dl/libexec/lib/python3.11/site-packages/youtube_dl/extractor/youtube.py: 'uploader_id': self._search_regex(r'/(?:channel|user)/([^/?&#]+)', owner_profile_url, 'uploader id', fatal=False) if owner_profile_url else None,

@gromgit
Copy link
Member

gromgit commented Apr 21, 2023

Well, you have the patched youtube-dl, so what's the output of:

readlink /usr/local/bin/youtube-dl
/usr/local/bin/youtube-dl -x "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

@ltgs
Copy link

ltgs commented Apr 21, 2023

So, I brew uninstalled youtube-dl, tried installing but it said it was already installed, manually deleted the directory, reinstalled it, and now it seems to be working (getting the warning).

I checked the lib folder too and now it has 2,387 files just like yours.

Phew! So many hoops but here we are.

Thanks for all your help @gromgit !

@github-actions github-actions bot added the outdated PR was locked due to age label May 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age python Python use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants