Skip to content

Search plugins storing BeautifulSoup objects in Entry cause excessive recursion in Entry::take_snapshot #1301

@danielkza

Description

@danielkza

Expected behaviour:

Flexget doesn't crash.

Actual behaviour:

Flexget crashes due to excessive recursion depth while taking the snapshot of an entry produced by the TorrentLeech search plugin.

Steps to reproduce:

Use the TorrentLeech search plugin in a task.

Config (snippet):

tasks:
  tv-discover:
    interval: 12 hours
    discover:
      what:
        - next_series_episodes: yes
      from:
        - torrentleech:
            rss_key: "{{ secrets.torrentleech.rsskey }}"
            username: "{{ secrets.torrentleech.username }}"
            password: "{{ secrets.torrentleech.password }}"
            category: Episodes HD
    transmission: yes

Additional information:

Debugging information

I'm not familiar with the Flexget codebase, but some quick debugging shows the problem is caused by the TL plugin inserting some text directly from the HTML tree produced by BeautifulSoup. That text is actually a bs4.element.NavigableString that contains references to the whole tree, which Flexget attempts to serialize when saving a snapshot of the entry.

The plugin should convert any such usages to unicode before storing it in the entry. It is possible other search plugins have the same issue, so a generic solution might be desirable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions