Skip to content

Commit

Permalink
Merge branch 'master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Dec 17, 2024
2 parents 13cf750 + 46ecd9b commit cc412cf
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ RUN apt-get update && \
cargo \
mktorrent \
rustc \
mono-complete && \
mono-complete \
nano && \
rm -rf /var/lib/apt/lists/*

# Set up a virtual environment to isolate our Python dependencies
Expand Down
5 changes: 5 additions & 0 deletions src/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def parse(self, args, meta):
parser.add_argument('-edition', '--edition', '--repack', nargs='*', required=False, help="Edition/Repack String e.g.(Director's Cut, Uncut, Hybrid, REPACK, REPACK3)", type=str, dest='manual_edition', default=None)
parser.add_argument('-season', '--season', nargs='*', required=False, help="Season (number)", type=str)
parser.add_argument('-episode', '--episode', nargs='*', required=False, help="Episode (number)", type=str)
parser.add_argument('-met', '--manual-episode-title', nargs=1, required=False, help="Set episode title, empty = empty", type=str, dest="manual_episode_title")
parser.add_argument('-daily', '--daily', nargs=1, required=False, help="Air date of this episode (YYYY-MM-DD)", type=datetime.date.fromisoformat, dest="manual_date")
parser.add_argument('--no-season', dest='no_season', action='store_true', required=False, help="Remove Season from title")
parser.add_argument('--no-year', dest='no_year', action='store_true', required=False, help="Remove Year from title")
Expand Down Expand Up @@ -242,6 +243,10 @@ def parse(self, args, meta):
meta[key] = 100
elif key in ("tag") and value == []:
meta[key] = ""
elif key in ["manual_episode_title"] and value == []:
meta[key] = ""
elif key in ["manual_episode_title"]:
meta[key] = value
else:
meta[key] = meta.get(key, None)
if key in ('trackers'):
Expand Down
13 changes: 11 additions & 2 deletions src/prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ async def process_tracker(tracker_name, meta):
tracks = meta.get('mediainfo').get('media', {}).get('track', []) # Get all tracks
bitrate = tracks[1].get('BitRate', '') if len(tracks) > 1 else '' # Get video bitrate if available
bitrate_oldMediaInfo = tracks[0].get('OverallBitRate', '') if len(tracks) > 0 else '' # For old MediaInfo (< 24.x where video bitrate is empty, use 'OverallBitRate' instead)
meta['episode_title'] = ""
if (bitrate.isdigit() and int(bitrate) >= 8000000) or (bitrate_oldMediaInfo.isdigit() and int(bitrate_oldMediaInfo) >= 8000000):
meta['service'] = "CR"
elif (bitrate.isdigit() or bitrate_oldMediaInfo.isdigit()): # Only assign if at least one bitrate is present, otherwise leave it to user
Expand Down Expand Up @@ -3476,7 +3477,10 @@ async def get_name(self, meta):
source = meta.get('source', "")
uhd = meta.get('uhd', "")
hdr = meta.get('hdr', "")
episode_title = meta.get('episode_title', '')
if meta.get('manual_episode_title'):
episode_title = meta.get('manual_episode_title')
else:
episode_title = meta.get('episode_title', '')
if meta.get('is_disc', "") == "BDMV": # Disk
video_codec = meta.get('video_codec', "")
region = meta.get('region', "")
Expand Down Expand Up @@ -3785,7 +3789,12 @@ async def get_season_episode(self, video, meta):
meta['season_int'] = season_int
meta['episode_int'] = episode_int

meta['episode_title_storage'] = guessit(video, {"excludes": "part"}).get('episode_title', '')
# Manual episode title
if meta['manual_episode_title'] == "":
meta['episode_title_storage'] = meta.get('manual_episode_title')
else:
meta['episode_title_storage'] = guessit(video, {"excludes": "part"}).get('episode_title', '')

if meta['season'] == "S00" or meta['episode'] == "E00":
meta['episode_title'] = meta['episode_title_storage']

Expand Down
4 changes: 2 additions & 2 deletions src/trackers/MTV.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def upload(self, meta, disctype):
await self.upload_with_retry(meta, cookiefile, common)

async def upload_with_retry(self, meta, cookiefile, common, img_host_index=1):
approved_image_hosts = ['ptpimg', 'imgbox']
approved_image_hosts = ['ptpimg', 'imgbox', 'imgbb']
images_reuploaded = False

if all(any(host in image['raw_url'] for host in approved_image_hosts) for image in meta['image_list']):
Expand Down Expand Up @@ -179,7 +179,7 @@ async def upload_with_retry(self, meta, cookiefile, common, img_host_index=1):

async def handle_image_upload(self, meta, img_host_index=1, approved_image_hosts=None, file=None):
if approved_image_hosts is None:
approved_image_hosts = ['ptpimg', 'imgbox']
approved_image_hosts = ['ptpimg', 'imgbox', 'imgbb']

retry_mode = False
images_reuploaded = False
Expand Down

0 comments on commit cc412cf

Please sign in to comment.