Skip to content

[add] Added free parameter to iptorrents search plugin#2697

Merged
liiight merged 3 commits intodevelopfrom
unknown repository
Jun 15, 2020
Merged

[add] Added free parameter to iptorrents search plugin#2697
liiight merged 3 commits intodevelopfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jun 8, 2020

Motivation for changes:

To be able to search IPTorrents for freeleech-only results.

Detailed changes:

  • Added a free parameter to the IPTorrents search plugin schema that will include &free=on in the URL if set to True.

Addressed issues:

  • N/A

Implemented feature requests:

  • N/A

Config usage if relevant (new plugin or updated schema):

    discover:
      what:
        - next_series_episodes: yes
      from:
        - iptorrents:
            rss_key: ***
            uid: ***
            password: ***
            free: True <---

Log and/or tests output (preferably both):

> bin/flexget execute --tasks SEARCH_TV --discover-now --no-cache
2020-06-08 15:57:28 VERBOSE  task_queue                    There are 1 tasks to execute. Shutdown will commence when they have completed.
2020-06-08 15:57:28 VERBOSE  series        SEARCH_TV       Series `RuPaul's Drag Race` is already configured in series plugin
2020-06-08 15:57:28 VERBOSE  series        SEARCH_TV       Series `Better Call Saul` is already configured in series plugin
2020-06-08 15:57:28 VERBOSE  discover      SEARCH_TV       Discovering 2 titles ...
2020-06-08 15:57:28 INFO     discover      SEARCH_TV       Ignoring interval because of --discover-now
2020-06-08 15:57:28 VERBOSE  discover      SEARCH_TV       Searching for `RuPaul's Drag Race S01E01` with plugin `iptorrents` (1 of 2)
2020-06-08 15:57:30 VERBOSE  discover      SEARCH_TV       Searching for `Better Call Saul S01E01` with plugin `iptorrents` (2 of 2)
2020-06-08 15:57:31 VERBOSE  details       SEARCH_TV       Produced 42 entries.
2020-06-08 15:57:31 VERBOSE  task          SEARCH_TV       ACCEPTED: `RuPauls Drag Race S01E01 1080p WEBRip x264...` by series plugin because choosing first acceptable match
2020-06-08 15:57:31 VERBOSE  task          SEARCH_TV       ACCEPTED: `Better Call Saul S01E01 Uno 1080p WEB-DL DD5 1 H 264...` by series plugin because choosing first acceptable match
2020-06-08 15:57:31 VERBOSE  limit_new     SEARCH_TV       Allowed RuPauls Drag Race S01E01 1080p WEBRip x264... (https://iptorrents.com/...)
2020-06-08 15:57:31 VERBOSE  limit_new     SEARCH_TV       Allowed Better Call Saul S01E01 Uno 1080p WEB-DL DD5 1 H 264... (https://iptorrents.com/...)
2020-06-08 15:57:31 VERBOSE  details       SEARCH_TV       Summary - Accepted: 2 (Rejected: 0 Undecided: 40 Failed: 0)

To Do:

  • Pending maintainer recommendations

@ghost
Copy link
Copy Markdown
Author

ghost commented Jun 8, 2020

IPTorrents functionality is great, but there is one major hindrance that I've experienced with it beyond the feature I'm implementing in this PR.

IPTorrents searches by the IMDB ID when you use the Movies or TV shows tabs. For TV show episodes, you can append a season number and episode number in the format S01E01 alongside the IMDB ID and it will still work as expected.

Currently Flexget appears to use the title of the show or movie which does not always return results, especially in the case of TV shows. I've tried inspecting the requests and responses to/from IPTorrents and I can't figure out where the IMDB ID succeeds in matching listings because it's not in the title and not in the tags.

Anyway, I'd like to implement searching by IMDB ID as a feature alongside this. Is there a list of plugins/components that would need to support injecting the IMDB ID into the search_strings entry field? I know one of them would be next_series_episodes.

@ghost ghost force-pushed the develop branch from d8d3533 to 1019714 Compare June 8, 2020 23:33
@ghost ghost force-pushed the develop branch from 1019714 to c11ec96 Compare June 8, 2020 23:35
@ghost
Copy link
Copy Markdown
Author

ghost commented Jun 10, 2020

I left another comment earlier about another feature request, if that could be addressed I'd like to get started on that in my spare time.

Copy link
Copy Markdown
Member

@liiight liiight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Everything works with these changes, correct?

@ghost
Copy link
Copy Markdown
Author

ghost commented Jun 11, 2020

I did some various testing to be sure before I gave the all-clear, and I discovered that the plugin was ultimately searching with URLs like https://www.iptorrents.com/t?q=Leave%2BNo%2BTrace%25282018%2529&qf= rather than https://www.iptorrents.com/t?q=Leave+No+Trace+%282018%29&qf=#torrents due to the usage of the of the quote_plus method from urllib.parse.

I also discovered that the freeleech-only search depends on where you place the free=on parameter in the URL. It must come directly after the /t? so it cannot depend on the params dict. I've added a new URL specifically for freeleech-only search that works with the rest of the params that may be passed.

You can see that the parameter now functions as expected, I confirmed the results using the web interface and by turning Freeleech on and off.

On:

2020-06-11 02:35:44 DEBUG    iptorrents    SEARCH_MOVIES   full search URL: https://iptorrents.com/t?free=on&q=Eight+Legged+Freaks+%282002%29&qf=
2020-06-11 02:35:44 DEBUG    iptorrents    SEARCH_MOVIES   No results found for search Eight Legged Freaks (2002)
2020-06-11 02:35:44 DEBUG    discover      SEARCH_MOVIES   No results from iptorrents
2020-06-11 02:35:44 VERBOSE  discover      SEARCH_MOVIES   No search results for `Eight Legged Freaks (2002)`

Off:

020-06-11 02:41:22 DEBUG    iptorrents    SEARCH_MOVIES   full search URL: https://iptorrents.com/t?q=Eight+Legged+Freaks+%282002%29&qf=
2020-06-11 02:41:22 DEBUG    iptorrents    SEARCH_MOVIES   Found entry <Entry(title=Eight Legged Freaks 2002 720p HDRip x264 [redacted],state=undecided)>
2020-06-11 02:41:22 DEBUG    iptorrents    SEARCH_MOVIES   Found entry <Entry(title=Eight Legged Freaks 2002 OM HDTV x264-[redacted],state=undecided)>
2020-06-11 02:41:22 DEBUG    iptorrents    SEARCH_MOVIES   Found entry <Entry(title=Eight Legged Freaks 2002 720p WEB-DL DD5 1 H 264-[redacted] mkv,state=undecided)>
2020-06-11 02:41:22 DEBUG    discover      SEARCH_MOVIES   Discovered 3 entries from iptorrents

@liiight liiight changed the title Added free parameter to iptorrents search plugin [add] Added free parameter to iptorrents search plugin Jun 15, 2020
@liiight liiight merged commit cbdfe80 into Flexget:develop Jun 15, 2020
@liiight
Copy link
Copy Markdown
Member

liiight commented Jun 15, 2020

@bobcatthebaker thank you for this!

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