-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SHRI improvement #343
Comments
Do you only want non-English in title? Upload-Assistant/src/trackers/HUNO.py Line 111 in 5e0eb31
|
Yes I want the non-English in the title. If there is only one Italian audio track you must write ITALIAN, two audio tracks you must write Dual-Audio. |
Something like this should work. async def upload(self, meta, disctype):
common = COMMON(config=self.config)
await common.edit_torrent(meta, self.tracker, self.source_flag)
name = await self.edit_name(meta)
.....
if nfo_file:
files['nfo'] = ("nfo_file.nfo", nfo_file, "text/plain")
data = {
'name': name,
.....
async def edit_name(self, meta):
shri_name = meta['name']
media_info_tracks = meta.get('media_info_tracks', []) # noqa #F841
resolution = meta.get('resolution')
if not meta['is_disc']:
def has_english_audio(tracks=None, media_info_text=None):
if media_info_text:
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
def get_audio_lang(tracks=None, is_bdmv=False, media_info_text=None):
if media_info_text:
match = re.search(r'Audio[\s\S]+?Language\s+:\s+(\w+)', media_info_text)
if match:
return match.group(1).upper()
return ""
try:
media_info_path = f"{meta['base_dir']}/tmp/{meta['uuid']}/MEDIAINFO.txt"
with open(media_info_path, 'r', encoding='utf-8') as f:
media_info_text = f.read()
if not has_english_audio(media_info_text=media_info_text):
audio_lang = get_audio_lang(media_info_text=media_info_text)
if audio_lang and not meta['audio'] == "Dual-Audio":
shri_name = aither_name.replace(meta['resolution'], f"{meta['resolution']} {audio_lang}", 1)
except (FileNotFoundError, KeyError) as e:
print(f"Error processing MEDIAINFO.txt: {e}")
return shri_name |
I get some mistakes:
`import asyncio from src.trackers.COMMON import COMMON class SHRI():
|
I just copy/pasted some code into notepad++, edited, and copy/pasted here. If it works, can you pr? |
Hi, I have a question to suggest on the SHRI tracker. If you see the AITHER tracker code that does a check on the audio track language, can you implement something similar for the SHRI tracker?
Let me give you an example, now the title of a file with the Italian audio track is named as follows:
Speak No Evil 2024 1080p BluRay DD+ 7.1 x265-iSlaNd
With the change should come out like this:
Speak No Evil 2024 1080p ITALIAN BluRay DD+ 7.1 x265-iSlaNd
This case applies only to files with a single audio track, when there are two audio tracks for example English and Italian must come out like this:
Speak No Evil 2024 1080p BluRay Dual-Audio DD+ 7.1 x265-iSlaNd
Thank.
The text was updated successfully, but these errors were encountered: