Skip to content

Conversation

@mm503
Copy link
Contributor

@mm503 mm503 commented Mar 22, 2025

Hi @mxpv,

I finished replacing YouTube-dl with yt-dlp since YouTube-dl had a last release nearly 4 years ago. I updated the textual references but left the config and internal variables untouched to retain compatibility with configurations out there.

While doing that, I also moved yt-dlp from /usr/bin to /usr/local/bin, which is better suited for external bins (one good use case is that you can easily override the whole /usr/local/bin directory in Kubernetes/Docker and add your own stuff there without affecting system bins).

And finally, I also changed the yt-dlp file permissions to 777 so the self-update feature works even for people who don't run the container as root.

I've been running the test build at home along with my other PR and it works well.

Log fragment:

│ time="2025-03-22T17:53:42Z" level=info msg="skipping due to max_age filter (223d > 14d)" episode_id=vtMy5l0rLx8 filter=max_age                                                                                                                                                  │
│ time="2025-03-22T17:53:42Z" level=info msg="skipping due to max_age filter (167d > 14d)" episode_id=xvDmR2n_D6E filter=max_age                                                                                                                                                  │
│ time="2025-03-22T17:53:42Z" level=info msg="skipping due to already downloaded" episode_id=y85OjRF5Ie8                                                                                                                                                                          │
│ time="2025-03-22T17:53:42Z" level=info msg="download count: 1"                                                                                                                                                                                                                  │
│ time="2025-03-22T17:53:42Z" level=info msg="! downloading episode https://youtube.com/watch?v=lDXxDA5uZvw" episode_id=lDXxDA5uZvw index=0                                                                                                                                       │
│ time="2025-03-22T17:53:53Z" level=info msg="creating file: /data/podsync/m-74gear/lDXxDA5uZvw.mp4" name=m-74gear/lDXxDA5uZvw.mp4                                                                                                                                                │
│ time="2025-03-22T17:53:54Z" level=info msg="successfully downloaded file \"lDXxDA5uZvw\"" episode_id=lDXxDA5uZvw index=0                                                                                                                                                        │
│ time="2025-03-22T17:53:54Z" level=info msg="downloaded 1 episode(s)"                                                                                                                                                                                                            │
│ time="2025-03-22T17:53:54Z" level=info msg="running cleaner" count=40 feed_id=m-74gear                                                                                                                                                                                          │
│ time="2025-03-22T17:53:54Z" level=info msg="creating file: /data/podsync/m-74gear.xml" name=m-74gear.xml

@mm503 mm503 mentioned this pull request Mar 22, 2025
@mm503 mm503 force-pushed the maint/reference_yt-dlp branch from 8bfb7bb to c822e7a Compare March 23, 2025 17:32
@mxpv
Copy link
Owner

mxpv commented Mar 31, 2025

@mm503 thanks for contribution! From what I understand, yt-dlp is a drop in replacement for youtube-dl, right? Can we just symlink ytdlp? Leaving both options on the table. I don't think we need to rename comments for this to work.

@mm503 mm503 force-pushed the maint/reference_yt-dlp branch from c822e7a to ad1b26c Compare June 10, 2025 01:30
@mm503
Copy link
Contributor Author

mm503 commented Jun 11, 2025

Hi @mxpv , sorry for the delay. I reverted the changes you brought up and limited the scope to setting more open permissions for the yt-dlp bin so it can self-update even in containers that don't run as root. I also moved the final path from /usr/bin/ to /usr/local/bin/ - this is because Kubernetes users can easily deploy a sidecar that runs on higher permissions upon startup and can download a new version of yt-dlp and mount over /usr/local/bin/ without affecting anything. (/usr/local/bin/ is also a better fit for the placement anyway, since it does not come with the OS).

While submitting the updates, I noticed that the golangci-lint was failing. I ended up updating to @v8 of the action and migrating the configuration to v2 config... and making 3 changes to the code to satisfy its findings.. hope that's ok.

The findings were:

~/git/podsync/ [maint/reference_yt-dlp*] golangci-lint run --config .golangci.yml
pkg/db/badger.go:275:3: QF1003: could use tagged switch on err (staticcheck)
		if err == nil {
		^
pkg/feed/xml.go:181:2: QF1002: could use tagged switch on ext (staticcheck)
	switch {
	^
pkg/ytdl/ytdl.go:230:2: QF1003: could use tagged switch on feedConfig.Format (staticcheck)
	if feedConfig.Format == model.FormatVideo {
	^
3 issues:
* staticcheck: 3

@mm503 mm503 force-pushed the maint/reference_yt-dlp branch from 6673426 to 260cca7 Compare June 11, 2025 00:01
@mm503 mm503 changed the title Finish replacing youtube-dl with yt-dlp Update yt-dlp permissions to allow self-update, fix CI Jun 11, 2025
@mxpv mxpv merged commit 6ed6502 into mxpv:main Jul 14, 2025
5 checks passed
@mm503 mm503 deleted the maint/reference_yt-dlp branch August 12, 2025 13:15
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

Successfully merging this pull request may close these issues.

2 participants