Skip to content

Commit

Permalink
Merge branch 'master' into tik
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Sep 26, 2024
2 parents d8772e6 + 3a4bebe commit 5184f7b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
10 changes: 8 additions & 2 deletions src/prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,9 @@ async def gather_prep(self, meta, mode):
meta['source'], meta['type'] = self.get_source(meta['type'], video, meta['path'], meta['is_disc'], meta)
if meta.get('service', None) in (None, ''):
meta['service'], meta['service_longname'] = self.get_service(video, meta.get('tag', ''), meta['audio'], meta['filename'])
elif meta.get('service'):
services = self.get_service(get_services_only=True)
meta['service_longname'] = max((k for k, v in services.items() if v == meta['service']), key=len, default=meta['service'])
meta['uhd'] = self.get_uhd(meta['type'], guessit(meta['path']), meta['resolution'], meta['path'])
meta['hdr'] = self.get_hdr(mi, bdinfo)
meta['distributor'] = self.get_distributor(meta['distributor'])
Expand Down Expand Up @@ -3019,8 +3022,7 @@ async def get_season_episode(self, video, meta):

return meta

def get_service(self, video, tag, audio, guess_title):
service = guessit(video).get('streaming_service', "")
def get_service(self, video=None, tag=None, audio=None, guess_title=None, get_services_only=False):
services = {
'9NOW': '9NOW', '9Now': '9NOW', 'AE': 'AE', 'A&E': 'AE', 'AJAZ': 'AJAZ', 'Al Jazeera English': 'AJAZ',
'ALL4': 'ALL4', 'Channel 4': 'ALL4', 'AMBC': 'AMBC', 'ABC': 'AMBC', 'AMC': 'AMC', 'AMZN': 'AMZN',
Expand Down Expand Up @@ -3068,6 +3070,10 @@ def get_service(self, video, tag, audio, guess_title):
'YT': 'YT', 'ZDF': 'ZDF', 'iP': 'iP', 'BBC iPlayer': 'iP', 'iQIYI': 'iQIYI', 'iT': 'iT', 'iTunes': 'iT'
}

if get_services_only:
return services
service = guessit(video).get('streaming_service', "")

video_name = re.sub(r"[.()]", " ", video.replace(tag, '').replace(guess_title, ''))
if "DTS-HD MA" in audio:
video_name = video_name.replace("DTS-HD.MA.", "").replace("DTS-HD MA ", "")
Expand Down
7 changes: 3 additions & 4 deletions src/trackers/AITHER.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,15 @@ async def get_flag(self, meta, flag_name):
async def edit_name(self, meta):
aither_name = meta['name']

# Helper function to check if English audio is present
def has_english_audio(tracks=None, media_info_text=None):
if meta['is_disc'] == "BDMV" and tracks:
for track in tracks:
if track.get('language', '').lower() == 'english':
return True
elif media_info_text:
audio_section = re.search(r'Audio[\s\S]+?Language\s+:\s+(\w+)', media_info_text)
if audio_section:
language = audio_section.group(1)
audio_section = re.findall(r'Audio[\s\S]+?Language\s+:\s+(\w+)', media_info_text)
for i, language in enumerate(audio_section):
language = language.lower().strip()
if language.lower().startswith('en'): # Check if it's English
return True
return False
Expand Down
2 changes: 1 addition & 1 deletion src/trackers/OTW.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class OTW():
def __init__(self, config):
self.config = config
self.tracker = 'OTW'
self.source_flag = 'OTW'
self.source_flag = 'OLD'
self.upload_url = 'https://oldtoons.world/api/torrents/upload'
self.search_url = 'https://oldtoons.world/api/torrents/filter'
self.signature = "\n[center][url=https://github.com/Audionut/Upload-Assistant]Created by L4G's Upload Assistant[/url][/center]"
Expand Down
2 changes: 1 addition & 1 deletion src/trackers/PSS.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, config):
self.search_url = 'https://privatesilverscreen.cc/api/torrents/filter'
self.signature = '\n[center][url=https://privatesilverscreen.cc/pages/1]Please Seed[/url][/center]'
self.banned_groups = ['4K4U', 'AROMA', 'd3g', 'edge2020', 'EMBER', 'EVO', 'FGT', 'NeXus', 'ION10', 'iVy', 'Judas', 'LAMA', 'MeGusta', 'nikt0', 'OEPlus', 'OFT', 'OsC', 'PYC',
'QxR', 'Ralphy', 'RARBG', 'RetroPeeps', 'SAMPA', 'Sicario', 'Silence', 'STUTTERSHIT', 'Tigole', 'TSP', 'TSPxL', 'Will1869', 'x0r', 'YIFY', 'core', 'ZMNT',
'QxR', 'Ralphy', 'RARBG', 'SAMPA', 'Sicario', 'Silence', 'STUTTERSHIT', 'Tigole', 'TSP', 'TSPxL', 'Will1869', 'x0r', 'YIFY', 'core', 'ZMNT',
'msd', 'nikt0', 'aXXo', 'BRrip', 'CM8', 'CrEwSaDe', 'DNL', 'FaNGDiNG0', 'FRDS', 'HD2DVD', 'HDTime', 'Leffe', 'mHD', 'mSD', 'nHD', 'nSD', 'NhaNc3', 'PRODJi',
'RDN', 'SANTi', 'ViSION', 'WAF', 'YTS', 'FROZEN', 'UTR', 'Grym', 'GrymLegacy', 'CK4', 'ProRes', 'MezRips', 'GalaxyRG', 'RCDiVX', 'LycanHD']
pass
Expand Down

0 comments on commit 5184f7b

Please sign in to comment.