mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2025-10-23 15:11:08 +00:00
feat(dl): Add support for services that do not support subtitle downloads
This commit is contained in:
@@ -541,7 +541,12 @@ class dl:
|
|||||||
events.subscribe(events.Types.TRACK_REPACKED, service.on_track_repacked)
|
events.subscribe(events.Types.TRACK_REPACKED, service.on_track_repacked)
|
||||||
events.subscribe(events.Types.TRACK_MULTIPLEX, service.on_track_multiplex)
|
events.subscribe(events.Types.TRACK_MULTIPLEX, service.on_track_multiplex)
|
||||||
|
|
||||||
if no_subs:
|
if hasattr(service, 'NO_SUBTITLES') and service.NO_SUBTITLES:
|
||||||
|
console.log("Skipping subtitles - service does not support subtitle downloads")
|
||||||
|
no_subs = True
|
||||||
|
s_lang = None
|
||||||
|
title.tracks.subtitles = []
|
||||||
|
elif no_subs:
|
||||||
console.log("Skipped subtitles as --no-subs was used...")
|
console.log("Skipped subtitles as --no-subs was used...")
|
||||||
s_lang = None
|
s_lang = None
|
||||||
title.tracks.subtitles = []
|
title.tracks.subtitles = []
|
||||||
@@ -906,6 +911,7 @@ class dl:
|
|||||||
while (
|
while (
|
||||||
not title.tracks.subtitles
|
not title.tracks.subtitles
|
||||||
and not no_subs
|
and not no_subs
|
||||||
|
and not (hasattr(service, 'NO_SUBTITLES') and service.NO_SUBTITLES)
|
||||||
and not video_only
|
and not video_only
|
||||||
and len(title.tracks.videos) > video_track_n
|
and len(title.tracks.videos) > video_track_n
|
||||||
and any(
|
and any(
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class EXAMPLE(Service):
|
|||||||
|
|
||||||
TITLE_RE = r"^(?:https?://?domain\.com/details/)?(?P<title_id>[^/]+)"
|
TITLE_RE = r"^(?:https?://?domain\.com/details/)?(?P<title_id>[^/]+)"
|
||||||
GEOFENCE = ("US", "UK")
|
GEOFENCE = ("US", "UK")
|
||||||
|
NO_SUBTITLES = True
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@click.command(name="EXAMPLE", short_help="https://domain.com")
|
@click.command(name="EXAMPLE", short_help="https://domain.com")
|
||||||
|
|||||||
Reference in New Issue
Block a user