Skip to content
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

[Aither] Foreign language not being added to name #300

Closed
kisiel92 opened this issue Jan 24, 2025 · 3 comments
Closed

[Aither] Foreign language not being added to name #300

kisiel92 opened this issue Jan 24, 2025 · 3 comments

Comments

@kisiel92
Copy link

Attempting to upload a season pack of a foreign TV Show to Aither which requires language in the name due to no English audio track present, but it's not being detected for either the entire season folder or for individual episode mkvs.

MediaInfo:

ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : A_AAC-2
Duration                                 : 53 min 19 s
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 73.2 MiB (15%)
Language                                 : Korean
Default                                  : Yes
Forced                                   : No

UA is pulling up the name as "Love in the Big City AKA Daedosiui Sarangbeob S01 1080p VIKI WEB-DL AAC 2.0 H.264" instead of "Love in the Big City AKA Daedosiui Sarangbeob S01 KOREAN 1080p VIKI WEB-DL AAC 2.0 H.264" per Aither naming requirements.

@Audionut
Copy link
Owner

Audionut commented Jan 25, 2025

Did you happen to have partial data in the tmp directory by chance? Can you delete everything from the associated tmp directory and try again if that was the case.

Else, please make sure you are using a recentish version, and advise if you can modify some source code files. This section can have some console prints added:

if not meta['is_disc']:

        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()
                        console.print(f"Language: {language}")
                        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:
                        console.print(f"Match: {match.group(1)}")
                        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)
                    console.print(f"Audio Language: {audio_lang}")
                    if audio_lang:
                        if (name_type == "REMUX" and source in ("PAL DVD", "NTSC DVD", "DVD")):
                            aither_name = aither_name.replace(str(meta['year']), f"{meta['year']} {audio_lang}", 1)
                        else:
                            aither_name = aither_name.replace(meta['resolution'], f"{audio_lang} {meta['resolution']}", 1)
            except (FileNotFoundError, KeyError) as e:
                print(f"Error processing MEDIAINFO.txt: {e}")

It seems fine here:

Tracker: AITHER, Upload: YES
Language: korean
Match: Korean
Audio Language: KOREAN
Request Data:
{
    'name': 'Love in the Big City AKA Daedosiui Sarangbeob S01 KOREAN 1080p TVING WEB-DL AAC 2.0 H.264-ARiC',

@kisiel92
Copy link
Author

Thanks for your quick response :)

I first deleted my tmp directory and retried without any changes. I used "git pull", checked for any updated requirements, and then added the 3 console.print lines to my AITHER.py file, but still not seeing the language added in the name.

Here's what I'm seeing in my terminal:

Gathering info for Love.in.the.Big.City.S01E01.1080p.VIKI.WEB-DL.AAC2.0.H.264.mkv
SRRDB: No match found
Exporting MediaInfo...
MediaInfo Exported.
No matches found on any trackers.
Building meta data.....
Prep material saved to /home/username/Upload-Assistant/tmp/Love.in.the.Big.City.S01E01.1080p.VIKI.WEB-DL.AAC2.0.H.264.mkv

Database Info
Title: Love in the Big City (2024)

Overview: Go Young, a gay Korean man, lives with Choi Mi-ae, a straight woman. 
Through Mi-ae's eyes, Go Young embarks on a journey of personal growth. He struggles with 
his relationship with his mother, who's in denial about his sexual orientation, and is forced to part ways 
with his lover Gyu-ho due to societal pressure. Recovering from his breakup, Go Young takes a trip 
to Thailand with a stranger, and manages to learn more about himself in the process.

Genre: Drama

Demographic:

Category: TV

TMDB: https://www.themoviedb.org/tv/236956
IMDB: https://www.imdb.com/title/tt30143510
TVDB: https://www.thetvdb.com/?id=440735&tab=series
TVMaze: https://www.tvmaze.com/shows/79251

1080p / WEBDL

Potentially missing information:
---------------------------------

--edition | Special Edition/Release


Is this correct?
Name: Love in the Big City AKA Daedosiui Sarangbeob S01E01 1080p VIKI WEB-DL AAC 2.0 H.264-kisiel92
Correct? [y/N]:

@Audionut
Copy link
Owner

Use -debug argument so that you can proceed to upload to Aither (debug does not actually upload anything) and trigger the console prints like I have in my previous post.

The Is this correct? is the general name that will be used virtually everywhere, it does not represent the name that will be used at every single site supported by UA. Aither is one of the few sites that wants foreign language in the name, that's why that code block I posted in the last post is in aither.py, because it only affects Aither naming.

Once you actually proceed to upload, the name will be modified to each sites individual standards as necessary.

I'm going to close this off, as the mediainfo block you posted is valid for the aither code to work, and I'm certain it's just your caution be overly cautious. Feel free to open if I'm wrong. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants