idlesign / torrt

Automates torrent updates for you
https://github.com/idlesign/torrt
BSD 3-Clause "New" or "Revised" License
112 stars 19 forks source link

fix trackers rutor get_id_from_link seo link [RUS] #62

Closed theonedemon closed 3 years ago

theonedemon commented 3 years ago

неправильно определяется Id торрента, если в SEO урле ( названии торрента ) есть символ "/" ( слеш )

url = 'http://rutor.info/torrent/795039/vanda/vizhn_wandavision-01h01-03-iz-09-2021-web-dl-720p-lostfilm'
splitted = url.rstrip('/').split('/')
result = splitted[-1]
if not result.isdigit():  # URL contains SEO name in the last chunk
    result = splitted[-2]
print(result) // vanda, not 795039
coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 127


Totals Coverage Status
Change from base Build 124: 0.4%
Covered Lines: 974
Relevant Lines: 1542

💛 - Coveralls
idlesign commented 3 years ago

Неплохо было бы актуализировать тест для разбора такого урла.

theonedemon commented 3 years ago

добавил тест

idlesign commented 3 years ago

Отлично! Влил. Попозже выпущу.