Compare commits
4 Commits
v0.5.9-bet
...
v0.6.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6f1eb06da | ||
|
|
94385d899e | ||
|
|
7577b88385 | ||
|
|
1b0b894acf |
16
config.yaml
16
config.yaml
@@ -32,18 +32,6 @@ threads: "16"
|
||||
# Set TV series to be sorted into respective season folders (true or false)
|
||||
seasons: "true"
|
||||
|
||||
# Set video options. See "N_m3u8DL-RE --morehelp select-video" for guidance. Default: best
|
||||
# Using --quality will override this quality setting
|
||||
video:
|
||||
track: "for=best"
|
||||
drop:
|
||||
## VIDEO/AUDIO/SUBTITLES:
|
||||
|
||||
# Set audio options. See "N_m3u8DL-RE --morehelp select-audio" for guidance. Default: best
|
||||
audio:
|
||||
track: "for=best"
|
||||
drop:
|
||||
|
||||
# Set subtitle options
|
||||
subtitles:
|
||||
no_mux: "false" # If "true", subtitles will be stored separately
|
||||
clean: "true" # Clean and convert subtitles. If "false", subtitles remain untouched
|
||||
# These settings are configured per service in /services/config
|
||||
@@ -103,7 +103,7 @@ class BBC(Config):
|
||||
episodes = [
|
||||
self.create_episode(episode)
|
||||
for season in seasons
|
||||
for episode in reversed(season["entities"]["results"])
|
||||
for episode in season["entities"]["results"]
|
||||
]
|
||||
return Series(episodes)
|
||||
|
||||
@@ -254,24 +254,6 @@ class BBC(Config):
|
||||
num_seasons = len(seasons)
|
||||
num_episodes = sum(seasons.values())
|
||||
|
||||
episode_count = {}
|
||||
extra_episode_number = 1
|
||||
|
||||
for index, episode in enumerate(content):
|
||||
if episode.number == 0 and episode.season == 0:
|
||||
episode.number = extra_episode_number
|
||||
extra_episode_number += 1
|
||||
|
||||
if episode.season == 0 and num_seasons == 1:
|
||||
episode.season = 1
|
||||
|
||||
if episode.number == 0 and episode.season > 0:
|
||||
if episode.season not in episode_count:
|
||||
episode_count[episode.season] = 0
|
||||
|
||||
episode.number = episode_count[episode.season]
|
||||
episode_count[episode.season] += 1
|
||||
|
||||
title = string_cleaning(str(content))
|
||||
|
||||
info(
|
||||
|
||||
@@ -71,6 +71,7 @@ class ITV(Config):
|
||||
description=episode.get("description"),
|
||||
)
|
||||
for series in data["seriesList"]
|
||||
if "Latest episodes" not in series["seriesLabel"]
|
||||
for episode in series["titles"]
|
||||
]
|
||||
)
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = "v0.5.9-beta (20231019)"
|
||||
__version__ = "v0.6.0-beta (20231022)"
|
||||
|
||||
@@ -26,7 +26,7 @@ class Options:
|
||||
if "," in self.episode:
|
||||
return self.get_episode_mix(series, self.episode)
|
||||
|
||||
episode = next((i for i in series if self.episode in str(i)), None)
|
||||
episode = next((i for i in series if self.episode.lower() in str(i).lower()), None)
|
||||
|
||||
if episode is not None and self.titles:
|
||||
info(f"{str(episode)}")
|
||||
@@ -45,7 +45,7 @@ class Options:
|
||||
|
||||
downloads = []
|
||||
for episode in series:
|
||||
if any(i in str(episode) for i in episode_range):
|
||||
if any(i.lower() in str(episode).lower() for i in episode_range):
|
||||
downloads.append(episode)
|
||||
|
||||
if self.titles:
|
||||
@@ -62,7 +62,7 @@ class Options:
|
||||
|
||||
downloads = []
|
||||
for episode in series:
|
||||
if any(i in str(episode) for i in episode_mix):
|
||||
if any(i.lower() in str(episode).lower() for i in episode_mix):
|
||||
downloads.append(episode)
|
||||
|
||||
if self.titles:
|
||||
|
||||
@@ -19,11 +19,15 @@ main_help = f"""
|
||||
\b
|
||||
Settings:
|
||||
Open config.yaml in your favorite text editor to configure
|
||||
global settings for download paths, filenames, video/audio, subtitles etc.
|
||||
global settings for download paths, filenames, muxer etc.
|
||||
\b
|
||||
You can configure each service to have its own settings by editing the correlating
|
||||
.yaml file in services/config. Any changes made here will override the global config for that
|
||||
particular service, while keeping the main config for other services.
|
||||
Video/audio/subtitle settings for each service are in the correlating
|
||||
.yaml file in services/config. Any changes made here will only affect that particular service.
|
||||
Default values for all services:
|
||||
\b
|
||||
Video: Best available
|
||||
Audio: Best available
|
||||
Subtitles: Cleaned SRT muxed in with videofile
|
||||
\b
|
||||
Instructions:
|
||||
This program has got two methods of downloading:
|
||||
@@ -32,6 +36,7 @@ main_help = f"""
|
||||
Provide the series main URL and request what to download from it:
|
||||
\b
|
||||
python freevine.py --episode S01E01 URL
|
||||
python freevine.py --episode "Name of episode" URL
|
||||
python freevine.py --season S01 URL
|
||||
python freevine.py --episode S01E01-S01E10 URL
|
||||
python freevine.py --episode S01E01,S03E07,S10E12 URL
|
||||
@@ -40,7 +45,7 @@ main_help = f"""
|
||||
\b
|
||||
NOTES:
|
||||
Always use main URL of series for this method, not episode URLs
|
||||
Use the "S01E01" format (Season 1, Episode 1) to request episodes
|
||||
Use the S01E01 format, or "episode name", to request episodes
|
||||
Use --episode S01E01-S01E10 to request a range of episodes (from the same season)
|
||||
Use --episode S01E01,S03E07,S10E12 (no spaces!) to request a mix of episodes
|
||||
Use --season S01,S03,S10 (no spaces!) to request a mix of seasons
|
||||
|
||||
@@ -25,9 +25,9 @@ class Episode:
|
||||
) -> None:
|
||||
if name is not None:
|
||||
name = name.strip()
|
||||
if re.match(r"Episode ?#?\d+", name, re.IGNORECASE):
|
||||
name = None
|
||||
elif name.lower() == title.lower():
|
||||
# if re.match(r"Episode ?#?\d+", name, re.IGNORECASE):
|
||||
# name = None
|
||||
if name.lower() == title.lower():
|
||||
name = None
|
||||
|
||||
self.id = id_
|
||||
@@ -45,12 +45,28 @@ class Episode:
|
||||
self.special = special
|
||||
|
||||
def __str__(self) -> str:
|
||||
return "{title} S{season:02}E{number:02} {name}".format(
|
||||
title=self.title,
|
||||
season=self.season,
|
||||
number=self.number,
|
||||
name=self.name or "",
|
||||
).strip()
|
||||
if self.season == 0 and self.number == 0:
|
||||
return "{title} {name}".format(title=self.title, name=self.name).strip()
|
||||
|
||||
elif self.season == 0 and self.number > 0:
|
||||
return "{title} E{number:02} {name}".format(
|
||||
title=self.title,
|
||||
number=self.number,
|
||||
name=self.name).strip()
|
||||
|
||||
elif self.number == 0 and self.season > 0:
|
||||
return "{title} S{season:02} {name}".format(
|
||||
title=self.title,
|
||||
season=self.season,
|
||||
name=self.name).strip()
|
||||
|
||||
else:
|
||||
return "{title} S{season:02}E{number:02} {name}".format(
|
||||
title=self.title,
|
||||
season=self.season,
|
||||
number=self.number,
|
||||
name=self.name or "",
|
||||
).strip()
|
||||
|
||||
def get_filename(self) -> str:
|
||||
name = "{title} S{season:02}E{number:02} {name}".format(
|
||||
|
||||
@@ -66,15 +66,25 @@ def set_filename(service: object, stream: object, res: str, audio: str):
|
||||
else:
|
||||
filename = service.config["filename"]["series"].format(
|
||||
title=stream.title,
|
||||
year=stream.year or None,
|
||||
season=f"{stream.season:02}",
|
||||
episode=f"{stream.number:02}",
|
||||
year=stream.year or "",
|
||||
season=f"{stream.season:02}" if stream.season > 0 else "",
|
||||
episode=f"{stream.number:02}" if stream.number > 0 else "",
|
||||
name=stream.name or "",
|
||||
resolution=f"{res}p" or "",
|
||||
service=stream.service,
|
||||
audio=audio,
|
||||
)
|
||||
|
||||
no_ep = r"(S\d+)E"
|
||||
no_sea = r"S(E\d+)"
|
||||
no_num = r"SE"
|
||||
if stream.number == 0:
|
||||
filename = re.sub(no_ep, r"\1", filename)
|
||||
if stream.season == 0:
|
||||
filename = re.sub(no_sea, r"\1", filename)
|
||||
if stream.season == 0 and stream.number == 0:
|
||||
filename = re.sub(no_num, "", filename)
|
||||
|
||||
filename = string_cleaning(filename)
|
||||
return filename.replace(" ", ".") if filename.count(".") >= 2 else filename
|
||||
|
||||
@@ -111,7 +121,11 @@ def set_save_path(stream: object, config, title: str) -> Path:
|
||||
save_path = downloads.joinpath(title)
|
||||
save_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
if stream.__class__.__name__ == "Episode" and config["seasons"] == "true":
|
||||
if (
|
||||
stream.__class__.__name__ == "Episode"
|
||||
and config["seasons"] == "true"
|
||||
and stream.season > 0
|
||||
):
|
||||
_season = f"Season {stream.season:02d}"
|
||||
save_path = save_path.joinpath(_season)
|
||||
save_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
Reference in New Issue
Block a user