Compare commits

...

2 Commits

Author SHA1 Message Date
lambda
8a03b7b324 NBLA: Update app_version 2026-03-26 12:08:41 +01:00
lambda
69566061ba NBLA: Extract episode numbers from label 2026-03-26 12:07:57 +01:00
2 changed files with 11 additions and 6 deletions

View File

@ -109,6 +109,7 @@ class NBLA(Service):
VIDEO_RE = r"https?://(?:www\.)?nebula\.tv/videos/(?P<slug>.+)"
CHANNEL_RE = r"^https?://(?:www\.)?nebula\.tv/(?P<slug>.+)"
EPISODE_LABEL_RE = re.compile("^Episode ([0-9]+)$")
@staticmethod
@click.command(name="NBLA", short_help="https://nebula.tv", help=__doc__)
@ -198,9 +199,8 @@ class NBLA(Service):
def get_chapters(self, title: Union[Episode, Movie]) -> list[Chapter]:
return []
def search(self) -> Generator[SearchResult, None, None]:
pass
return
#self.title
r = self.session.get(self.config["endpoints"]["search"], params=params)
r.raise_for_status()
@ -226,12 +226,19 @@ class NBLA(Service):
# Specials episode numbers will then likely be off, use caution and
# check TMDB for manual corrections.
season_number = 0
self.log.warn(f"Could not extract season information, guessing season {season_number}")
self.log.warn(f"Could not extract season information from {season['label']}, guessing season {season_number}")
for episode_number, episode in enumerate(season["episodes"], start=1):
if not episode["video"] or (video_id_filter and video_id_filter != episode["video"]["id"]):
continue
# Episodic content usually has a label like "Episode 1". Try to use that to
# fetch the episode number. Alternatively, fall back to just the enumerated
# numbers (these usually work well enough, but sometimes content is listed
# in reverse order)
if match := self.EPISODE_LABEL_RE.match(episode['label']):
episode_number = int(match.group(1))
yield Episode(
id_=episode["video"]["id"],
service=self.__class__,
@ -242,8 +249,6 @@ class NBLA(Service):
number=episode_number,
)
def get_content(self, slug, video_id_filter=None):
r = self.session.get(self.config["endpoints"]["content"].format(slug=slug))
content = r.json()

View File

@ -10,4 +10,4 @@ endpoints:
video: https://content.api.nebula.app/content/videos/{slug}/
video_channel: https://content.api.nebula.app/video_channels/{id}/
video_channel_episodes: https://content.api.nebula.app/video_channels/{id}/video_episodes/?ordering=published_at
manifest: https://content.api.nebula.app/video_episodes/{video_id}/manifest.m3u8?token={jwt}&app_version=26.2.0&platform=web&all_manifest=true
manifest: https://content.api.nebula.app/video_episodes/{video_id}/manifest.m3u8?token={jwt}&app_version=26.4.0&platform=web&all_manifest=true