diff --git a/README.md b/README.md index 713e1ff..9f61826 100644 --- a/README.md +++ b/README.md @@ -426,6 +426,7 @@ Tested so far on Amazon, AppleTVPlus, Max, and DisneyPlus. - [ ] Fix `-sl all` and `-al all` - [ ] Make a windscribe.py for proxies modelled after nordvpn.py. Refer to the chrome extension for the code. - [ ] Move to requests, curl or otherwise to download subtitles (?) + - [ ] Replace track.dv, track.hdr10 with track.PQ. Value will be an enum. This will require a major-ish rewrite. - [ ] Netflix service is currently broken (will probably be fixed Soon™) - [ ] Integrate [subby](https://github.com/vevv/subby) - [ ] Licensing before download (?) diff --git a/vinetrimmer/commands/dl.py b/vinetrimmer/commands/dl.py index 8e1be9e..eabadad 100644 --- a/vinetrimmer/commands/dl.py +++ b/vinetrimmer/commands/dl.py @@ -278,6 +278,8 @@ def get_credentials(service, profile="default"): help="Force muxing when using --audio-only/--subs-only/--chapters-only.") @click.option("-ss", "--strip-sdh", is_flag=True, default=False, help="Stip SDH subtitles and convert them to CC. Plus fix common errors.") +@click.option("-mf", "--match-forced", is_flag=True, default=False, + help="Only select forced subtitles matching with specified audio language") @click.pass_context def dl(ctx, profile, cdm, *_, **__): log = logging.getLogger("dl") @@ -330,7 +332,7 @@ def dl(ctx, profile, cdm, *_, **__): @dl.result_callback() @click.pass_context -def result(ctx, service, quality, closest_resolution, range_, wanted, alang, slang, acodec, audio_only, subs_only, chapters_only, audio_description, audio_channels, max_audio_compatability, +def result(ctx, service, quality, closest_resolution, range_, wanted, alang, slang, acodec, audio_only, subs_only, chapters_only, audio_description, audio_channels, max_audio_compatability, match_forced, list_, keys, cache, no_cache, no_subs, no_audio, no_video, no_chapters, atmos, vbitrate, abitrate: int, no_mux, mux, selected, latest_episode, strip_sdh, *_, **__): def ccextractor(): log.info("Extracting EIA-608 captions from stream with CCExtractor") @@ -436,7 +438,8 @@ def result(ctx, service, quality, closest_resolution, range_, wanted, alang, sla else: title.tracks.select_videos(by_quality=quality, by_vbitrate=vbitrate, by_range=range_, one_only=True) title.tracks.select_audios(by_language=alang, by_bitrate=abitrate, with_descriptive=audio_description, by_codec=acodec, by_channels=audio_channels, max_audio_compatability=max_audio_compatability) - title.tracks.select_subtitles(by_language=slang, with_forced=True) + forced = alang if (match_forced and alang) else True + title.tracks.select_subtitles(by_language=slang, with_forced=forced) except ValueError as e: log.error(f" - {e}") continue diff --git a/vinetrimmer/utils/MSL/__init__.py b/vinetrimmer/utils/MSL/__init__.py index 021892e..db8802e 100644 --- a/vinetrimmer/utils/MSL/__init__.py +++ b/vinetrimmer/utils/MSL/__init__.py @@ -343,7 +343,7 @@ class MSL: def send_message(self, endpoint, params, application_data, userauthdata=None): message = self.create_message(application_data, userauthdata) - res = self.session.post(url=endpoint, data=message, params=params, verify=False) + res = self.session.post(url=endpoint, data=message, params=params, verify=False) # verify=True? header, payload_data = self.parse_message(res.text) if "errordata" in header: raise self.log.exit(