-
Notifications
You must be signed in to change notification settings - Fork 165
Various changes #488
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
Various changes #488
Conversation
This change was originally intended to support a verbosity parameter. However, the method to do this was too complicated, and required us to redefine too many functions. Instead, it will be used to pass other configuration like ChromeCast alias or styling information.
CATT is currently keeping track of the `verbosity` variable, which defaults to 0 unless CATT is run with flag `-v`. This flag can stack (up to `-vvvv`). Severl functions were defined to print debugging messages, but only if `verbosity` is enough for each specific message: - echo_warning() - echo_info() - echo_verbose() - echo_debug() - echo_trace() Also ran `pre-commit autoupdate`
If a user tries to cast from their local computer an HLS or DASH manifest, and the stream type is not set to LIVE or BUFFERED, CATT will detect it, issue a warning, and set it to BUFFERED. CATT will now also send the correct MIME type when such a file is cast. Support for Smooth Streaming is unchanged for lack of working example files for testing. Additionally, CATT silently ignored any format selector provided to yt-dlp. Currently, if a format selector is provided, CATT will accept this but warn the user that no compatibility checks will be made. (CATT will not check if the format is invalid, or simply incompatible with the current ChromeCast). If no format selector is provided, CATT will silently choose the best format as usual. Also StreamInfo.guessed_content_type is now a regular variable and not a property calculated on the fly (because it depends on ephemeral information for remote files) and the HTTP server also responds now to HEAD requests, in order to avoid confusing errors when casting DASH manifests locally.
The same command used to switch subtitles can be used to switch between audio tracks, provided that a stream with more than one is cast. This command now also outputs type of tracks, language of tracks, and a tick besides the tracks currently selected.
The code to load new tracks (e.g. for subtitles) is now in its on function, for easier reuse. Added more filters to BEST_MAX_2K, as 1st-gen ChromeCasts are not compatible with newer formats.
This tiny change accepts videos where the parameter is unknown in every filter. This is needed for videos that do not have metadata, or M3U8 manifests that link directly to TS files (and also have no metadata)
BUFFERED is always the stream type by default. The flag to override this is obviously --stream-type live, not --stream-type BUFFERED
|
Sorry, what does this PR do? "Various changes" isn't very descriptive, and each logically distinct change should really be in its own PR, so it can be merged independently. Thanks for your contribution! |
|
I agree. Though, in this case, pretty much every commit here does its own thing. Basically, this PR does four things:
I can split it however you want me to, but all commits use the debugging functions I added, so I'd like you to review those first and tell me if you want them or not. If you want them, I'll split that into its own commit and wait for you to merge it; if no, I'll rewrite the other commits to not make use of them. |
|
The verbosity levels seem like a great feature, though I feel like you're reinventing |
|
It is pretty much the same, I just thought You're the boss, though. If you're okay with adding a new dependency for CATT, I can do a couple tests with the |
|
Since |
|
Roger that. I may take a bit, but I'll close this PR and open a new one only to add logging. Then I'll create a separate one for video selection and QOL, then a new one for M3U8. |
Each commit includes a changelog.
I've been working on this code for days on my computer. None of the commits should be broken (the script should work normally no matter which commit do you pick) but I had to edit my commits several times. In particular, my original debugging functions were a nightmare to set up, and replacing them force me to amend all the following commits.
My original intention was to unblock YouTube videos again, but so far, I haven't had any luck.
Newish videos on YouTube (from the last two years?) currently can't be downloaded in a merged format. The only options are:
The first option works out of the box for the Tears of Steel test video at
lolitemaultes/m3u8-urlsand for streams from RTVE (Spanish public TV), but when CATT selects a YouTube M3U8 manifest, it just shows the Cast icon over black background.I couldn't find any way to root my ChromeCast, or figure out debugging. I tried casting video only then adding audio tracks, but not only does the ChromeCast not add them, it stops responding to CATT commands other than
catt stop.Subtitling code should probably go to
subs_info.py, but right now moving more code around will take me several days and result in no extra functionality.Any help is welcome.
EDIT:
api.py... but I just made a tiny change in order not to break the API. (If inputdevice_desctoStreamInfo()was optional, the dictsettingsreplacing it must be optional too).Clickinstead of @click (I'm sorry if I pinged them for no reason).