Skip to content

Update lostfilm.py - #424

Open
zalessky wants to merge 1 commit into
werwolfby:developfrom
zalessky:patch-2
Open

Update lostfilm.py#424
zalessky wants to merge 1 commit into
werwolfby:developfrom
zalessky:patch-2

Conversation

@zalessky

Copy link
Copy Markdown

Поддержка зеркал + адаптация к новой разметке сайта

Поддержка зеркал + адаптация к новой разметке сайта
SaintMortum added a commit to SaintMortum/monitorrent that referenced this pull request Aug 24, 2026
Squashed and hand-verified subset of werwolfby#424 (zalessky, "Поддержка
зеркал + адаптация к новой разметке сайта"). The original PR rewrote
the whole file (+264/-862): dropped DB migrations, inlined
LostFilmTVTracker into the plugin, removed timeout/proxy kwargs and
the Cloudflare cookie refresh flow. This keeps that architecture and
carries over only the actual site-adaptation fixes:

- _play_episode_re allowed cat only up to 3 digits and required a
  fixed single-quoted, unspaced onclick body; shows with cat >= 1000
  failed to match and crashed with AttributeError on .group('episode').
  Now accepts single/double quotes, extra whitespace and 4-digit cat.
- _follow_show_re: same quoting relaxation for FollowSerial(...).
- _parse_series: episodes used to be found via a fixed
  table.movie-parts-list > tr > td.zeta > div chain that no longer
  matches current markup; now matches any onclick=PlayEpisode node
  inside a season block. Also guards missing series-block/h2, skips
  the season-as-a-whole pseudo-episode (999) and duplicate episodes.
- get_download_info: meta-refresh parsing picked the first <meta> tag
  (usually charset, no content attr -> KeyError) and assumed an
  absolute redirect URL. Mirrors return a relative path, which made
  the follow-up request fail with requests.exceptions.MissingSchema.
  Now finds the refresh meta specifically and resolves the URL with
  urljoin against the tracker domain.
- _prepare_request: (topic.season, topic.episode) > latest_episode
  raised TypeError on Python 3 when topic.episode was None (season
  set without an episode) or when a season number was a tuple
  (fractional season). None is now treated as 0 and tuple season
  numbers are skipped instead of crashing.

Not carried over from werwolfby#424: removal of DB migrations, tracker/plugin
merge, requests.Session() replacing tracker_settings timeout/proxy
kwargs, dropped Cloudflare cookie refresh, and behavior changes to
login()/verify()/check_download() error handling.
@SaintMortum SaintMortum mentioned this pull request Aug 24, 2026
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

Successfully merging this pull request may close these issues.

1 participant