Repository navigation
fix: parse Russian "N сезон (A-B из C)" as season N with an episode range - #70
Merged
Viren070 merged 1 commit intoOct 6, 2026
Merged
Conversation
…ange
The season-range handler matched the word "сезон" and then took the
episode range in the following brackets as seasons when the season
number came before the word: "2 сезон (1-13 из 13)" gave seasons 1-13,
"1-8 сезон (1-73 из 73)" gave seasons 1-73 and episodes 1-8.
Skip the handler when "сезон" is preceded by a standalone one- or
two-digit number (optionally with "-й"), so the "N сезон" and
"A-B сезон" handlers pick up the season and the range is parsed as
episodes. Digits that end another token ("S02", "1923", "90210") do not
block it. "Сезон 1-8", "Сезоны 1-3 из 8" and
"Сезон: 2 / Серии: 1-10 из 10" are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #66 / #67. Another common Russian season-pack notation (RuTor, Bitru, MegaPeer) puts the season number before the word "сезон" and the episode range in brackets with "из" ("of"), without the word "серии". The season-range handler grabbed that bracketed episode range as seasons.
Клан Сопрано 2 сезон (1-13 из 13) / The Sopranos (2000) WEB-DLКлан Сопрано 2Клан СопраноДрузья 5 сезон (1-24 из 24) / Friends (1998) BDRipСимпсоны 10-й сезон (1-23 из 23) / The SimpsonsИгра престолов 1-8 сезон (1-73 из 73) / Game of ThronesИгра престолов 1-7 сезон: (1-67 из 67) / Game of ThronesChange
One line in
src/handlers.ts: the season-range handler now skips the Russian[Сс]езон[иы]?branch when the word is preceded by a standalone one- or two-digit number (optionally with-й):The season is then picked up by the existing
N сезон/A-B сезонhandlers and the range by the episode-range handler. Digits that end another token (S02 сезон,1923 Сезон 1-2,90210 Сезон 1-5) don't block it. The other alternatives (seasons,sezon,temporadas,stagioni) are untouched.I first tried a lookahead on
изafter the range instead, but it brokeСезон 1-8 из 8andСезоны 1-3 из 8, where the range really is seasons.Tests
Added 9 tests to
seasons.test.ts: the cases above, plus regression checks for(1-8 сезон: 1-73 серии из 73),Сезон 2 (1-10 из 10),Сезоны 1-3 из 11and1923 Сезон 1-2. The full suite passes (38 suites, 1329 tests).I also compared
mainand this branch on 5,742 real titles from Russian trackers (15 TV series and 25 anime): 151 titles changed, all from "seasons 1..N" to "season N, episodes 1..M" (plus the season number leaving the title). No changes to year, resolution or languages, and no regressions.Context
In AIOStreams, a request for S03E02 returned packs like
2 сезон (1-13 из 13)for every episode of seasons 1–13, and a complete-series pack1-8 сезон (1-73 из 73)disappeared from episode 9 onwards.