Skip to content

Conversation

danielmawhirter
Copy link
Contributor

"Get next best resolution or codec instead" has a minimum quality capped by VIDEO_HEIGHT_CUTOFF with no method to bypass it. This is undesirable when adding a Playlist source, where audio-only is not desired, but that would be the only way to trigger a download.

Allow video heights down to 120px to allow "next best" to fallback as far as necessary.

Possible better ways to resolve this:

  • Have a configuration in the Source to define the lowest tolerable resolution (optionally allowing audio-only fallback)
  • Expose a page in the webapp that allows global configuration, would require settings persistence to db

Both of these possibilities seem potentially desirable, but are much larger scope than this patch. If there's appetite, I may be willing to take on one of those projects.

@meeb
Copy link
Owner

meeb commented Nov 22, 2024

Thanks for the PR. The current behavior is by design, without this limitation it causes (or used to at least) significant reports of terrible quality downloads when some media items default to 144p for some people in some situations. The "fall back to audio only if the video quality is terrible" option might work, however this could be more complex than it first appears as the download location would have to also dynamically change to avoid mixing media formats in single libraries for media servers.

The last time I looked at the 144p issue was a couple of years ago so the behavior and fallback of YouTube may have changed since then.

What specifically is your use case where downloading 144p media with tubesync? Are you saying you're interested in the audio only so don't care about the video quality? The core use case of tubesync is a PVR for YouTube so downloading 144p media is an edge case at best, failing downloads with only 144p streams was a preferable hack / compromise.

@danielmawhirter
Copy link
Contributor Author

The problem case is a playlist full of music videos where one video only has streams up to 144p (technically 180px vertical), where I'd like to download all of them as videos, but would be ok falling back to very low resolution or even audio-only if it's called for

Heard on the point of complication with falling back to audio-only though.

I'd assume the ideal way to solve this is some user-side configurability. I've seen some issues on the milestones that lead me to believe a Settings page is called for, but that's also a significant undertaking.

Selfishly, what about exposing this parameter as an environment variable? It seems to be a common practice in django settings files that would allow this to be overriden

@meeb
Copy link
Owner

meeb commented Nov 22, 2024

Yeah I have less of an issue with that, it maintains the current behavior while allowing you to tweak it as needed. Just note that (at some point when I ever get the time) a settings page does appear it may replace this and you'll have to adjust your config. Can you quickly add this to the README as well please?

@danielmawhirter
Copy link
Contributor Author

Sounds like a good plan, and so added

@danielmawhirter danielmawhirter changed the title allow fallback to 144p Configure minimum permitted video height with VIDEO_HEIGHT_CUTOFF env var Nov 24, 2024
@meeb
Copy link
Owner

meeb commented Nov 24, 2024

Thanks!

@meeb meeb merged commit 0d5a0b0 into meeb:main Nov 24, 2024
@meeb
Copy link
Owner

meeb commented Dec 11, 2024

@danielmawhirter note that I have renamed VIDEO_HEIGHT_CUTOFF to TUBESYNC_VIDEO_HEIGHT_CUTOFF to keep the tubesync related env vars named consistently as of 2c12bf5

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