can you give me an updated file of the code I sent you that has a fix?
Assistant
it's trying to match against a title
I'm trying to play episode 1 of season 5 and I click on that episode
this is the title I'm trying to match
YVCIEQYS23ZYC/House.Of.Cards.2013.S05E01.1080p.BluRay.REMUX.AVC.DTS-HD.MA.5.1-NOGRP.mkv
but for some reason it doesn't match that and instead gives me
House.Of.Cards.2013.S05E10.1080p.BluRay.REMUX.AVC.DTS-HD.MA.5.1-NOGRP.mkv
can you go through each string and explain it's missing finding
S05E01
and instead finds
S05E10
Below is a detailed walk‐through of each regex string in your function and how the way the episode number is inserted can lead to the unintended matching of “S05E10” instead of “S05E01”. In short, the problem is that some of the regexes are built with the non–zero‐padded episode number (usingstr_episodewhich is"1") instead of the consistently two–digit version (episode_fillwhich is"01"). When you use just"1", the expression may “see” a match inside a larger number like “10” because it isn’t forcing the match to stop after a single digit. Let’s break down each string:
Intended purpose:This pattern is meant to match variations like “S05E01”, “s05-e01-”, “s5e01.”, etc.
The problem:When you use the non–padded version for the episode (i.e."1"), the regex is looking for “…e[p]?[.-]?1…” without insisting that the “1” is a complete token. In a filename that has “S05E10”, the beginning “S05E1” (i.e. the “1” of “10”) can be mistakenly seen as a match for the pattern that expects “1” followed by a separator. In “S05E10”, after the “1” comes a “0” rather than a dot or dash—but if the engine isn’t enforcing a strict word boundary after the digit, it can match the “1” even though it’s really part of “10.”
With the other combinations (e.g. usingstr_seasonorstr_episode), you get versions like “...5...episode...01…” or “...05[x.]1…” etc.
Intended purpose:It is meant to catch titles that write out “Season 05 Episode 01” or shorthand forms like “05x01”.
The problem:Once again, when the non–padded episode “1” is used, the second half (]) might match portions of a larger number. In a file labeled “S05E10”, the “x01” part (if present in any variant) or the loose “1” can be matched as a substring of “10”, especially because there are no boundaries stopping extra digits from being attached.
Intended purpose:This regex appears to be aimed at catching “double episodes” or split episodes (for example, where the filename might indicate a combined “01-02” episode).
The problem:Neither version should match a standalone S05E01. In the first, “s05e00…” does not appear in your title; in the second, the pattern demands “e02” after “e01”, which also does not appear. So these patterns aren’t matching your intended S05E01—but importantly, they don’t directly cause the confusion with S05E10.
Intended purpose:This pattern intends to match cases where the season and episode numbers are standalone tokens preceded by a separator (a dot or dash). It might catch the “.05.01.” sequence if that appears independently in the string.
The problem:Since the title “House.Of.Cards.2013.S05E01…” embeds the numbers as part of “S05E01”, a pattern that requires a separator right before the season number might not match correctly. Furthermore, if the version using “01” is replaced with a version using “1”, it is at risk of matching portions of a longer number (for example, if “5” and “1” are matched without ensuring that “1” is isolated).
Intended purpose:To catch titles that include the literal word “episode” followed by the episode number.
The problem:Your title does not have the word “episode”, so this pattern isn’t relevant to your case. However, again the non–padded “1” is used, which in other contexts risks matching parts of “10” if that word appeared.
Intended purpose:This pattern is intended to match a separator followed by an “e” (with an optional “p”) and then the episode number.
The problem:If you had instead used the non–padded version, a pattern might match “e1” inside “e10” if there isn’t a strict boundary. Although here you are using “01” (which is good), any inconsistency across patterns can lead the matching routine to pick the wrong file when multiple regexes come into play.
Intended purpose:This complex lookahead pattern checks that somewhere in the string there is a “.e01.” (allowing for possible extra zeros before “01”) and then—using a negative lookahead—it ensures the entire string does not contain another competing season/episode pattern. This is an extra measure to try to isolate the correct match.
The problem:If you were to use a non–padded episode number here, it wouldn’t enforce a clear token boundary. The use of0*<>is meant to allow for “01”, “001”, etc. However, if the wrong version is used, the engine might interpret a “1” incorrectly as it could appear as part of another number like “10” especially if the negative lookahead doesn’t correctly eliminate the wrong candidate.
Overall Diagnosis and Resolution
Thekey issueis that you’re constructing some of your patterns withstr_episode(which is simply"1") and others withepisode_fill(which is"01"). When a non–padded number is inserted into the pattern, it loses the guarantee that only a complete, isolated number is matched. In a filename where the episode is “01”, if any regex is built with just “1”, that regex can mistakenly match the “1” in “10” (as in S05E10) because it isn’t enforcing that the match stops after a single digit (for example, by using a word boundary like\b).
To fix this, you should:
Be consistentand always use the padded version (episode_fill) in your regex patterns.
Consider adding explicit boundaries (for instance,\bor end–of–string/lookahead checks) after the episode number in each pattern to ensure that “1” does not inadvertently match the first digit in “10.”
Be consistentand always use the padded version (episode_fill) in your regex patterns.
Consider adding explicit boundaries (for instance,\bor end–of–string/lookahead checks) after the episode number in each pattern to ensure that “1” does not inadvertently match the first digit in “10.”
By ensuring every regex expects “01” (with the leading zero) and by anchoring the number so that extra digits are not accepted, you should avoid the problem of matching S05E10 when you intend to match S05E01.
I hope this step–by–step breakdown clarifies how each regex is constructed, why inconsistent formatting (padded vs non–padded) can lead to erroneous matches, and what steps you might take to resolve the issue.
which string matches it first, it has to be in one of the strings
so the addon is asking for season 5 episode 1
he pack contains files with this lablelling
House.Of.Cards.2013.S05E01.1080p.BluRay.REMUX.AVC.DTS-HD.MA.5.1-NOGRP.mkv
House.Of.Cards.2013.S05E10.1080p.BluRay.REMUX.AVC.DTS-HD.MA.5.1-NOGRP.mkv
he whole code for this is
-- coding: utf-8 --
import re
import json
from urllib.parse import unquote, unquote_plus
from modules.metadata import episodes_meta
from modules.settings import date_offset
from modules.kodi_utils import supported_media, set_property, notification
from modules.utils import adjust_premiered_date, get_datetime, jsondate_to_datetime, subtract_dates
try: result = [i['title'] for i in aliases]
except: result = []
return result
def make_alias_dict(meta, title):
code
aliases = []
alternative_titles = meta.get('alternative_titles', [])
original_title = meta['original_title']
country_codes = set([i.replace('GB', '<REDACTED>') for i in meta.get('country_codes', [])])
if alternative_titles: aliases = [{'title': i, 'country': ''} for i in alternative_titles]
if original_title not in alternative_titles: aliases.append({'title': original_title, 'country': ''})
if country_codes: aliases.extend([{'title': '%s %s' % (title, i), 'country': ''} for i in country_codes])
return aliases
import unicodedata
try:
title = ''.join(c for c in unicodedata.normalize('NFKD', title) if unicodedata.category(c) != '<REDACTED>')
return str(title)
except: return title
def pack_enable_check(meta, season, episode):
code
try:
status = <REDACTED>']
if status in ('Ended', 'Canceled'): return True, True
adjust_hours, current_date = date_offset(), get_datetime()
episodes_data = episodes_meta(season, meta)
unaired_episodes = [adjust_premiered_date(i['premiered'], adjust_hours)[0] for i in episodes_data]
if None in unaired_episodes or any(i > current_date for i in unaired_episodes): return False, False
else: return True, False
except: pass
return False, False
def clear_scrapers_cache(silent=False):
code
from caches.base_cache import clear_cache
for item in ('internal_scrapers', 'external_scrapers'): <REDACTED>, silent=True)
if not silent: notification('Success')
def supported_video_extensions():
code
supported_video_extensions = supported_media().split('|')
return [i for i in supported_video_extensions if not i in ('','.zip','.rar','.iso')]
try:
all_titles = [title]
if aliases: all_titles += aliases
cleaned_titles = []
cleaned_titles_append = cleaned_titles.append
year = str(year)
for i in all_titles:
cleaned_titles_append(
i.lower().replace('\'', '')<REDACTED>(':', '')<REDACTED>('!', '')<REDACTED>('(', '')<REDACTED>(')', '').replace('&', 'and').replace(' ', '.').replace(year, ''))
release_title = strip_non_ascii_and_unprintable(release_title).lstrip('/ ').replace(' ', '.').replace(':', '.').lower()
releasetitle_startswith = release_title.startswith
for i in unwanted_tags():
if <REDACTED>i_startswith = i.startswith
pattern = r'\%s' % i if i_startswith('[') or i_startswith('+') else r'%s' % i
release_title = re.sub(r'^%s' % pattern, '', release_title, 1, re.I)
release_title = release_<URL>trip('.-:/')
release_title = re.sub(r'^\[.*?]', '', release_title, 1, re.I)
release_title = release_title.lstrip('.-[](){}:/')
if season:
if season == 'pack': hdlr = ''
else:
try: hdlr = seas_ep_filter(season, episode, release_title, return_match=True)
except: return False
else: hdlr = year
if hdlr:
release_title = release_title.split(hdlr.lower())[0]
release_title = release_title.replace(year, '')<REDACTED>('(', '')<REDACTED>(')', '').replace('&', 'and').rstrip('.-').rstrip('.').rstrip('-').replace(':', '')
if not any(release_title == i for i in cleaned_titles): return False
else:
release_title = release_title.replace(year, '')<REDACTED>('(', '')<REDACTED>(')', '').replace('&', 'and').rstrip('.-').rstrip('.').rstrip('-').replace(':', '')
if not any(i in release_title for i in cleaned_titles): return False
return True
except: return True
def strip_non_ascii_and_unprintable(text):
code
try:
result = ''.join(char for char in text if char in printable)
return result.encode('ascii', errors='ignore').decode('ascii', errors='ignore')
except: pass
return text
try:
if not title: return
title = <REDACTED>()
title = re.sub(r'&#(\d+);', '', title)
title = re.sub(r'(&#[0-9]+)([^;^0-9]+)', '<REDACTED>', title)
title = title.replace('"', '\"').replace('&', '&')
title = re.sub(r'\n|([\[({].+?[})\]])|([:;–\-"\',!_.?~$@])|\s', '', title)
except: pass
return title
def url_strip(url):
code
try:
url = unquote_plus(url)
if 'magnet:' in url: url = url.split('&dn=')[1]
url = url.lower().replace("'", "").lstrip('.').rstrip('.')
title = re.sub(r'[^a-z0-9]+', ' ', url)
if 'http' in title: return None
if title == '': return None
return title
except: return None
title = None
if name_info: title = name_info
elif url: title = url_strip(url)
if not title: return 'SD', ''
quality = get_release_quality(title) or default_quality
info = get_info(title)
return quality, info
def get_release_quality(release_info):
code
if any(i in release_info for i in ('.scr.', 'screener', 'dvdscr', 'r', '.dvd.scr', '.r5', '.r6', '.dvd.scr', '.r5', '.r6')):
return 'SCR'
if any(i in release_info for i in ('.cam.', 'camrip', 'hdcam', '.hd.cam', 'hqcam', '.hq.cam', 'cam.rip', 'dvdcam')):
return 'CAM'
if any(i in release_info for i in ('.tc.', '.ts.', 'tsrip', 'hdts', 'hdtc', '.hd.tc', 'dvdts', 'telesync', 'tele.sync', 'telecine', 'tele.cine')):
return 'TELE'
if any(i in release_info for i in ('720', '720p', '720i', 'hd720', '720hd', 'hd720p', '72o', '72op')):
return '720p'
if any(i in release_info for i in ('1080', '1080p', '1080i', '', '1080hd', 'hd1080p', 'm1080p', 'fullhd', 'full.hd', '1o8o', '1o8op', '108o', '108op', '1o80', '1o80p')):
return '1080p'
if any(i in release_info for i in ('.4k', '<REDACTED>', '4khd', '.uhd', 'ultrahd', 'ultra.hd', 'hd2160', '2160hd', '2160', '2160p', '216o', '216op')):
return '4K'
return None
what is this string buisness and why is it picking up episde 10 when the addon is trying to match season 5 episode 1
The problem turns out not to be that none of your regexes “see” S05E01 at all but that one of them—the one built using the non–zero–padded episode number—is too loose and ends up matching a portion of “S05E10” before any of the “correct” patterns can confirm S05E01.
Let break down how the alternatives are built and why the one using the unpadded episode is the culprit:
How the Regex Variations Are Constructed
Your function builds a composite pattern by creating several versions of a “season/episode” matcher. For season 5 and episode 1 you define:
The rest of the string templates (fromstring2throughstring7) similarly create variants—some using the padded value for the episode, others using the unpadded value.
Which Alternative Is Picking Up S05E10?
When your addon is asked to find season 5 episode 1, it compiles the combined alternation from all these strings into one regex. When there are multiple alternatives, the regex engine tests them in order. In your case, the first two alternatives (which use the padded episode value, “01”) will not match the file
Because this version inserts the non–zero–padded"1"for the episode, it is not strict enough: it simply looks for the literal “s05” followed (optionally with a separator) by “e”, then (again optionally with a separator) by “1”, and finally expects a separator after that “1.” In the file for episode 10, the segment “S05E10” contains “e10” where the “1” at the start of “10” satisfies the literal “1” in the pattern. (Since the pattern does not enforce a word boundary afterward, that “1” inside “10” is enough to let the regex return a match.)
Thus, even though “S05E10” is a different number, that alternative “sees” the “1” (the first digit of “10”) and—with a following dot (from the “”) matching the trailing[.-]—the regex engine returns a match for the S05E10 title.
Because the alternatives are checked in order, the first alternative that produces a match is the one from string1 using the non–padded episode number (the third alternative). Once a match is returned from the file name for S05E10, the addon treats that file as the correct episode—even though you intended to play S05E01.
In Summary
Which string matches first?It is the third variant built from yourstring1template:
Pattern:(s05[.-]?e[p]?[.-]?1[.-])
Pattern:(s05[.-]?e[p]?[.-]?1[.-])
Why?Because it uses the unpadded episode value ("1") instead of"01"and does not enforce boundaries around the “1.” This lets it mistakenly match the “1” in “10” from S05E10. In effect, the regex “sees” a valid match in the wrong filename and picks that file over the one that actually has S05E01.
How to Fix It
•Be consistent with padding:Use the zero–filled episode number (“01”) in all of your regex substitutions.
•Add explicit boundaries:For example, you could add a word boundary (\b) or a lookahead to ensure that the episode number isn’t immediately followed by another digit.
By making these adjustments, the regex will only match the full token “01” and will not inadvertently match part of “10.”
Below is an updated version of your function with changes that force the regex patterns to always use the two‐digit (zero–padded) episode number. In addition, I altered the “trailing separator” section of the patterns so that they require either a dot/dash or the end of the string (using a non–capturing group with (?:[.-]|$)). This helps prevent a lone “1” from matching inside “10.”
The changes are as follows:
Always Use the Padded Episode Number:I removed the two alternatives that were substituting the non–padded episode (i.e. usingstr_episode). Now every pattern usesepisode_fill(which is"01"for episode 1), ensuring the regex won’t match just a “1” that might be part of a larger number (like “10”).
Require a Separator or End of String After the Episode Number:Rather than ending each pattern with a hardcoded[.-], the patterns now end with a non–capturing group(?:[.-]|$). This enforces that the matched episode number is either immediately followed by a dot or dash or is at the end of the string—helping prevent accidental matches such as the “1” in “10.”
Always Use the Padded Episode Number:I removed the two alternatives that were substituting the non–padded episode (i.e. usingstr_episode). Now every pattern usesepisode_fill(which is"01"for episode 1), ensuring the regex won’t match just a “1” that might be part of a larger number (like “10”).
Require a Separator or End of String After the Episode Number:Rather than ending each pattern with a hardcoded[.-], the patterns now end with a non–capturing group(?:[.-]|$). This enforces that the matched episode number is either immediately followed by a dot or dash or is at the end of the string—helping prevent accidental matches such as the “1” in “10.”
pythonCopy , episode, release_title, split=False, return_match=False):
import re
from urllib.parse import unquote
code
str_season, str_episode = str(season), str(episode)
season_fill, episode_fill = str_season.zfill(2), str_episode.zfill(2)
str_ep_plus_1, str_ep_minus_1 = str(episode+1), str(episode-1)
release_title = re.sub(r'[^A-Za-z0-9-]+', '.', unquote(release_title).replace("'", "")).lower()
# Updated regex strings with changes:
# - The trailing [.-] is now replaced with (?:[.-]|$) to enforce a separator or string end.
# - Removed alternatives that substituted a non–padded episode (str_episode).
string1 = r'(s<<S>>[.-]?e[p]?[.-]?<<E>>(?:[.-]|$))'
string2 = r'(season[.-]?<<S>>[.-]?episode[.-]?<<E>>(?:[.-]|$))|([s]?<<S>>[x.]<<E>>(?:[.-]|$))'
string3 = r'(s<<S>>e<<E1>>[.-]?e?<<E2>>(?:[.-]|$))'
string4 = r'([.-]<<S>>[.-]?<<E>>(?:[.-]|$))'
string5 = r'(episode[.-]?<<E>>(?:[.-]|$))'
string6 = r'([.-]e[p]?[.-]?<<E>>(?:[.-]|$))'
string7 = r'(^(?=.*\.e?0*<<E>>\.)(?:(?!((?:s|season)[.-]?\d+[.-x]?(?:ep?|episode)[.-]?\d+)|\d+x\d+).)*$)'
string_list = []
string_list_append = string_list.append
# For string1, only use the padded version for the episode.
string_list_append(string1.replace('<<S>>', season_fill).replace('<<E>>', episode_fill))
string_list_append(string1.replace('<<S>>', str_season).replace('<<E>>', episode_fill))
# For string2, again only use the padded episode value.
string_list_append(string2.replace('<<S>>', season_fill).replace('<<E>>', episode_fill))
string_list_append(string2.replace('<<S>>', str_season).replace('<<E>>', episode_fill))
# Leave string3 as is (its episode parts already use the padded value in one alternative).
string_list_append(string3.replace('<<S>>', season_fill)
.replace('<<E1>>', str_ep_minus_1.zfill(2))
.replace('<<E2>>', episode_fill))
string_list_append(string3.replace('<<S>>', season_fill)
.replace('<<E1>>', episode_fill)
.replace('<<E2>>', str_ep_plus_1.zfill(2)))
# For <REDACTED>, only use the padded episode.
string_list_append(string4.replace('<<S>>', season_fill).replace('<<E>>', episode_fill))
string_list_append(string4.replace('<<S>>', str_season).replace('<<E>>', episode_fill))
# For string5 and string6, use the padded episode.
string_list_append(string5.replace('<<E>>', episode_fill))
string_list_append(string6.replace('<<E>>', episode_fill))
# String7 already uses the padded episode.
string_list_append(string7.replace('<<E>>', episode_fill))
final_string = '|'.join(string_list)
reg_pattern = re.compile(final_string)
if split:
return release_title.split(re.search(reg_pattern, release_title).group(), 1)[1]
if return_match:
return re.search(reg_pattern, release_title).group()
return bool(re.search(reg_pattern, release_title))
Explanation of Changes
Removed Non-Padded Episode Substitutions:I deleted the calls that usedstr_episode(for example, lines likepythonCopy codestring_list_append(string1.replace('<>', season_fill).replace('<>', str_episode))and similarly for string2). This ensures that the regex is always built with the zero–padded episode (e.g. “01”) rather than a lone “1” that could inadvertently match part of “10.”
Changed the Trailing Separator:Every regex pattern that previously ended with[.-]now ends with(?:[.-]|$). This means the pattern expects either a dot or a dashorthe end of the string immediately following the episode number. That prevents the pattern from matching when there’s another digit (as in “10”) immediately after the episode number.
Removed Non-Padded Episode Substitutions:I deleted the calls that usedstr_episode(for example, lines like
and similarly for string2). This ensures that the regex is always built with the zero–padded episode (e.g. “01”) rather than a lone “1” that could inadvertently match part of “10.”
Changed the Trailing Separator:Every regex pattern that previously ended with[.-]now ends with(?:[.-]|$). This means the pattern expects either a dot or a dashorthe end of the string immediately following the episode number. That prevents the pattern from matching when there’s another digit (as in “10”) immediately after the episode number.
Together, these fixes ensure that when the addon is asked to match Season 5, Episode 1, it only finds filenames containing the exact “S05E01” pattern and does not mistakenly match the “S05E10” file.
Feel free to adjust the separator choice if your file-naming conventions change.
# thanks 123Venom and gaiaaaiaai, whom I knicked most of this code from. :)
info = []
info_append = info.append
if any(i in title for i in ('.3d.', '.sbs.', '.hsbs', 'sidebyside', 'side.by.side', 'stereoscopic', '.tab.', '.htab.', 'topandbottom', 'top.and.bottom')):
info_append('[B]3D[/B]')
if '.sdr' in title:
info_append('SDR')
elif any(i in title for i in ('dolby.vision', 'dolbyvision', '.dovi.', '.dv.')):
info_append('[B]D/VISION[/B]')
elif any(i in title for i in ('2160p.bluray.hevc.truehd', '2160p.bluray.hevc.dts', '2160p.bluray.hevc.lpcm', '2160p.blu.ray.hevc.truehd', '2160p.blu.ray.hevc.dts',
'2160p.uhd.bluray', '2160p.uhd.blu.ray', '2160p.us.bluray.hevc.truehd', '2160p.us.bluray.hevc.dts', '.hdr.', 'hdr10', 'hdr.10', 'uhd.bluray.2160p', 'uhd.blu.ray.2160p')):
info_append('[B]HDR[/B]')
elif all(i in title for i in ('2160p', 'remux')):
info_append('[B]HDR[/B]')
if '[B]D/VISION[/B]' in info:
if any(i in title for i in ('.hdr.', '.hdr10.', 'hdr.10')) or 'hybrid' in title:
info_append('[B]HDR[/B]')
if '[B]HDR[/B]' in info:
info_append('[B]HYBRID[/B]')
if any(i in title for i in ('avc', '', 'h.264', 'h.264', 'x264', 'x.264')):
info_append('AVC')
elif '.av1.' in title:
info_append('[B]AV1[/B]')
elif any(i in title for i in ('', 'h.265', 'hevc', 'x265', 'x.265')):
info_append('[B]HEVC[/B]')
elif any(i in info for i in ('[B]HDR[/B]', '[B]D/VISION[/B]')):
info_append('[B]HEVC[/B]')
if any(i in title for i in ('.imax.', '.(imax).', '.(.imax.).')):
info_append('IMAX')
elif any(i in title for i in ('.enhanced.', '.upscaled.', '.enhance.', '.upscale.')):
info_append('[B]AI ENHANCED/UPSCALED[/B]')
if '.atvp' in title:
info_append('APPLETV+')
elif any(i in title for i in ('xvid', '.x.vid')):
info_append('XVID')
elif any(i in title for i in ('divx', 'div2', 'div3', 'div4')):
info_append('DIVX')
if any(i in title for i in ('remux', 'bdremux')):
info_append('REMUX')
if any(i in title for i in ('bluray', 'blu.ray', 'bdrip', 'bd.rip')):
info_append('BLURAY')
elif any(i in title for i in ('dvdrip', 'dvd.rip')):
info_append('DVD')
elif any(i in title for i in ('.web.', 'webdl', 'web.dl', 'web-dl', 'webrip', 'web.rip')):
info_append('WEB')
elif 'hdtv' in title:
info_append('HDTV')
elif 'pdtv' in title:
<REDACTED>')
elif any(i in title for i in ('.hdrip', '.hd.rip')):
info_append('HDRIP')
if 'atmos' in title:
info_append('ATMOS')
if any(i in title for i in ('true.hd', 'truehd')):
info_append('TRUEHD')
if any(i in title for i in ('dolby.digital.plus', 'dolbydigital.plus', 'dolbydigitalplus', 'dd.plus.', 'ddplus', '.ddp.', 'ddp2', 'ddp5', 'ddp7', 'eac3', '.e.ac3')):
info_append('DD+')
elif any(i in title for i in ('.dd.ex.', 'ddex', 'dolby.ex.', 'dolby.digital.ex.', 'dolbydigital.ex.')):
info_append('DD-EX')
elif any(i in title for i in ('dd2.', 'dd5', 'dd7', 'dolby.digital', 'dolbydigital', '.ac3', '.ac.3.', '.dd.')):
info_append('DD')
if 'aac' in title:
info_append('AAC')
elif 'mp3' in title:
info_append('MP3')
elif '.flac.' in title:
info_append('FLAC')
elif 'opus' in title and not title.endswith('opus.'):
info_append('OPUS')
if any(i in title for i in ('.dts.x.', 'dtsx')):
info_append('DTS-X')
elif any(i in title for i in ('hd.ma', 'hdma')):
info_append('DTS-HD MA')
elif any(i in title for i in ('dts.hd.', 'dtshd')):
info_append('DTS-HD')
elif '.dts' in title:
info_append('DTS')
if any(i in title for i in ('ch8.', '8ch.', '7.1ch', '7.1.')):
info_append('8CH')
elif any(i in title for i in ('ch7.', '7ch.', '6.1ch', '6.1.')):
info_append('7CH')
elif any(i in title for i in ('ch6.', '6ch.', '5.1ch', '5.1.')):
info_append('6CH')
elif any(i in title for i in ('ch2', '2ch', '2.0ch', '2.0.', 'audio.2.0.', 'stereo')):
info_append('2CH')
if '.wmv' in title:
info_append('WMV')
elif any(i in title for i in ('.mpg', '.mp2', '.mpeg', '.mpe', '.mpv', '.mp4', '.m4p', '.m4v', 'msmpeg', 'mpegurl')):
info_append('MPEG')
elif '.avi' in title:
info_append('AVI')
elif any(i in title for i in ('.mkv', 'matroska')):
info_append('MKV')
if any(i in title for i in ('hindi.eng', 'ara.eng', 'ces.eng', 'chi.eng', 'cze.eng', 'dan.eng', 'dut.eng', 'ell.eng', 'esl.eng', 'esp.eng', 'fin.eng', 'fra.eng', 'fre.eng',
'frn.eng', 'gai.eng', 'ger.eng', 'gle.eng', 'gre.eng', 'gtm.eng', 'heb.eng', 'hin.eng', 'hun.eng', 'ind.eng', 'iri.eng', 'ita.eng', 'jap.eng', 'jpn.eng', 'kor.eng',
'lat.eng', 'lebb.eng', 'lit.eng', 'nor.eng', 'pol.eng', 'por.eng', 'rus.eng', 'som.eng', 'spa.eng', 'sve.eng', 'swe.eng', 'tha.eng', 'tur.eng', 'uae.eng', 'ukr.eng',
'vie.eng', 'zho.eng', 'dual.audio', 'multi')):
info_append('MULTI-LANG')
if any(i in title for i in ('1xbet', 'betwin')):
info_append('ADS')
if any(i in title for i in ('subita', 'subfrench', 'subspanish', 'subtitula', 'swesub', 'nl.subs', 'subbed')):
info_append('SUBS')
return ' | '.join(filter(None, info))