Twisted Sister - Stay Hungry -2016- -flac 24-192- -

Twisted Sister - Stay Hungry -2016- -flac 24-192- -

Returns: dict: artist, album, year, format, bit_depth, sample_rate, original """ # Remove leading/trailing spaces and separators clean = text.strip(' -_')

# Default values result = 'artist': None, 'album': None, 'year': None, 'format': None, 'bit_depth': None, 'sample_rate': None, 'original': text Twisted Sister - Stay Hungry -2016- -FLAC 24-192-

return result test_string = "Twisted Sister - Stay Hungry -2016- -FLAC 24-192-" parsed = parse_audio_folder_name(test_string) Returns: dict: artist

# Extract year (4 digits, possibly in -YEAR- or _YEAR_) year_match = re.search(r'[-_]?(?P<year>\d4)[-_]?', clean) if year_match: result['year'] = int(year_match.group('year')) clean = re.sub(r'[-_]?\d4[-_]?', '', clean).strip(' -_') Twisted Sister - Stay Hungry -2016- -FLAC 24-192-

# Split remaining by common separators parts = re.split(r'[-_]1,2', clean) parts = [p.strip() for p in parts if p.strip()]

# Heuristic: first part = artist, second = album (if available) if len(parts) >= 2: result['artist'] = parts[0] result['album'] = parts[1] elif len(parts) == 1: result['album'] = parts[0]

"Twisted Sister - Stay Hungry -2016- -FLAC 24-192-"

Оставьте комментарий!

grin LOL cheese smile wink smirk rolleyes confused surprised big surprise tongue laugh tongue rolleye tongue wink raspberry blank stare long face ohh grrr gulp oh oh downer red face sick shut eye hmmm mad angry zipper kiss shock cool smile cool smirk cool grin cool hmm cool mad cool cheese vampire snake excaim question

Используйте нормальные имена. Ваш комментарий будет опубликован после проверки.

Вы можете войти под своим логином или зарегистрироваться на сайте.

Twisted Sister - Stay Hungry -2016- -FLAC 24-192- (обязательно)