internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: Flexget/Flexget

Issue:
nyaa changed TLD
hi peeps. it seems they switched TLD from .eu to .se

i changed my local flexget/plugins/sites/nyaa.py, removed the pyc & reloaded the daemon. its pulling stuff. but i aint got the skills to send a pull request, so i thought i'd do the next best thing and say something

if you don't want to do anything, i guess thats fine too. the old is redirecting to the new


Discussion:

Resolving patch:
diff --git a/flexget/plugins/sites/nyaa.py b/flexget/plugins/sites/nyaa.py
--- a/flexget/plugins/sites/nyaa.py
+++ b/flexget/plugins/sites/nyaa.py
@@ -47,7 +47,7 @@ def search(self, task, entry, config):
         entries = set()
         for search_string in entry.get('search_strings', [entry['title']]):
             name = normalize_unicode(search_string)
-            url = 'http://www.nyaa.eu/?page=rss&cats=%s&filter=%s&term=%s' % (
+            url = 'http://www.nyaa.se/?page=rss&cats=%s&filter=%s&term=%s' % (
                 CATEGORIES[config['category']], FILTERS.index(config['filter']), quote(name.encode('utf-8')))
 
             log.debug('requesting: %s' % url)
@@ -79,7 +79,7 @@ def search(self, task, entry, config):
         return entries
 
     def url_rewritable(self, task, entry):
-        return entry['url'].startswith('http://www.nyaa.eu/?page=torrentinfo&tid=')
+        return entry['url'].startswith('http://www.nyaa.se/?page=torrentinfo&tid=')
 
     def url_rewrite(self, task, entry):
         entry['url'] = entry['url'].replace('torrentinfo', 'download')


Test patch:
diff --git a/flexget/tests/test_urlrewriting.py b/flexget/tests/test_urlrewriting.py
--- a/flexget/tests/test_urlrewriting.py
+++ b/flexget/tests/test_urlrewriting.py
@@ -19,7 +19,7 @@ class TestURLRewriters(object):
               - {title: 'tbp torrent', url: 'http://torrents.thepiratebay.se/8492471/Test.torrent'}
               - {title: 'tbp torrent subdomain', url: 'http://torrents.thepiratebay.se/8492471/Test.avi'}
               - {title: 'tbp torrent bad subdomain', url: 'http://torrent.thepiratebay.se/8492471/Test.avi'}
-              - {title: 'nyaa', url: 'http://www.nyaa.eu/?page=torrentinfo&tid=12345'}
+              - {title: 'nyaa', url: 'http://www.nyaa.se/?page=torrentinfo&tid=12345'}
               - {title: 'cinemageddon download', url: 'http://cinemageddon.net/details.php?id=1234'}
     """
 
@@ -53,10 +53,10 @@ def test_nyaa_torrents(self, execute_task):
         task = execute_task('test')
         entry = task.find_entry(title='nyaa')
         urlrewriter = self.get_urlrewriter('nyaa')
-        assert entry['url'] == 'http://www.nyaa.eu/?page=torrentinfo&tid=12345'
+        assert entry['url'] == 'http://www.nyaa.se/?page=torrentinfo&tid=12345'
         assert urlrewriter.url_rewritable(task, entry)
         urlrewriter.url_rewrite(task, entry)
-        assert entry['url'] == 'http://www.nyaa.eu/?page=download&tid=12345'
+        assert entry['url'] == 'http://www.nyaa.se/?page=download&tid=12345'
 
     def test_cinemageddon(self, execute_task):
         task = execute_task('test')
Repository: Flexget/Flexget

Issue:
Adding new column to `plugins` output
I'm trying to understand the concepts of 'phase' and 'interface' of a plugin. The output of the CLI command `flexget plugins` has been helpful. But I think I noticed that the output is missing a column. It has 'Keyword', 'Phases' and 'Flags', but no 'Interfaces'. I found out that all plugins _do_ defined a list of interfaces for themselves. 

Shall I create a PR adding the column 'Interfaces' to the output?
I wanted to ask before I put the effort in.

And if someone can explain what a 'phase' and 'interface' is I'll write up a wiki page. ;)


Discussion:
Seems like a good idea to me.

Interface is a sort of new concept to describe what role a plugin can fill, now that we have more than one. The 'task' interface is the main one, which are all the plugins that can be configured directly inside a task. Other notable interfaces are 'list', which can be configured inside of one of the list controlling plugins (list_add, list_match, list_remove, etc.), 'notifiers' which are configured inside 'notify' plugin.

Phases are mostly meant to be internal, so that the user _shouldn't_ (in most common cases) need to worry about what order plugins in a task run. A task is run by executing a sequence of phases in order (input, filter, output) being the main 3. The 'task' interface plugins can hook any one (or more) of these phases to make sure they run in a certain order within the task. (e.g. all plugins hooking the input phase need to run to generate the entries before a plugin hooking the filter phase can decide whether the entries are wanted or not.)

Resolving patch:
diff --git a/flexget/plugins/cli/plugins.py b/flexget/plugins/cli/plugins.py
--- a/flexget/plugins/cli/plugins.py
+++ b/flexget/plugins/cli/plugins.py
@@ -15,11 +15,12 @@
 def plugins_summary(manager, options):
     if options.table_type == 'porcelain':
         disable_all_colors()
-    header = ['Keyword', 'Phases', 'Flags']
+    header = ['Keyword', 'Interfaces', 'Phases', 'Flags']
     table_data = [header]
     for plugin in sorted(get_plugins(phase=options.phase, interface=options.interface)):
         if options.builtins and not plugin.builtin:
             continue
+
         flags = []
         if plugin.instance.__doc__:
             flags.append('doc')
@@ -29,6 +30,7 @@ def plugins_summary(manager, options):
             if not options.debug:
                 continue
             flags.append('developers')
+
         handlers = plugin.phase_handlers
         roles = []
         for phase in handlers:
@@ -36,7 +38,7 @@ def plugins_summary(manager, options):
             roles.append('{0}({1})'.format(phase, priority))
 
         name = colorize('green', plugin.name) if 'builtin' in flags else plugin.name
-        table_data.append([name, ', '.join(roles), ', '.join(flags)])
+        table_data.append([name, ', '.join(plugin.interfaces), ', '.join(roles), ', '.join(flags)])
 
     try:
         table = TerminalTable(options.table_type, table_data, wrap_columns=[1, 2])


Test patch:
Repository: Flexget/Flexget

Issue:
rutracker_auth plugin does not work anymore after recent changes in rutracker's login page
### Expected behaviour:
Accepted torrents from rutracker.org gets downloaded

### Actual behaviour:
Accepted torrents from rutracker.org fails to download

### Steps to reproduce:
- Step 1: define rutracker_auth with correct credentials in config file
- Step 2: execute task with rutracker_auth plugin

#### Config:
```
...
rutracker_task
  accept_all: yes
  rutracker_auth:
    username: '{? rutracker.username ?}'
    password: '{? rutracker.password ?}'

  inputs:
    - rss: http://feed.rutracker.org/atom/f/313.atom

  deluge: yes
```
  
#### Log:
Missed log with exception since I fixed it already. See below

### Additional information:
```
Flexget version is 2.9.8 installed by pip
Python version 2.7.12
OS: Ubuntu 16.04
```

I already fixed it myself:
Edit /usr/local/lib/python2.7/dist-packages/flexget/plugins/sites/rutracker.py
change login URL in this line:
```
s.post("http://login.rutracker.org/forum/login.php", data=payload)
```
to
```
s.post("http://rutracker.org/forum/login.php", data=payload)
```
and URL in this line
```
r.prepare_url(url='http://dl.rutracker.org/forum/dl.php?t=' + id, params=None)
```
to this
```
r.prepare_url(url='http://rutracker.org/forum/dl.php?t=' + id, params=None)
```

Please add this fix to the next public Flexget versions. Thanks!



Discussion:
Please open a PR with the fix 
@liiight my first PR. Sorry if I did something wrong
@liiight @cvium 
I've created PR in my fork, what should I do to send it to main flexget repository?
https://github.com/dchubkov/Flexget/pull/1
you need to commit to your fork and then open the PR here against your fork. Notice you can select different sources for comparison when opening PR

Resolving patch:
diff --git a/flexget/plugins/sites/rutracker.py b/flexget/plugins/sites/rutracker.py
--- a/flexget/plugins/sites/rutracker.py
+++ b/flexget/plugins/sites/rutracker.py
@@ -65,7 +65,7 @@ class RutrackerAuth(AuthBase):
     def try_authenticate(self, payload):
         for _ in range(5):
             s = RSession()
-            s.post("http://login.rutracker.org/forum/login.php", data=payload)
+            s.post("http://rutracker.org/forum/login.php", data=payload)
             if s.cookies and len(s.cookies) > 0:
                 return s.cookies
             else:
@@ -103,7 +103,7 @@ def __call__(self, r):
         r.prepare_body(data=data, files=None)
         r.prepare_method('POST')
         r.prepare_url(
-            url='http://dl.rutracker.org/forum/dl.php?t=' + id, params=None)
+            url='http://rutracker.org/forum/dl.php?t=' + id, params=None)
         r.prepare_headers(headers)
         r.prepare_cookies(self.cookies_)
         return r


Test patch:
Repository: Flexget/Flexget

Issue:
Add helpful message when `flexget series list` is empty
When no series are tracked/configured the command `flexget series list` returns an empty list.
That is not to say flexget doesn't know about *any* series, they might simply be unconfigured. The series can be viewed with the `flexget series list all` (or `flexget series list unconfigured`) command.

Currently the output of `flexget series list` is:
```shell
$ flexget series list

lqqqqqqwqqqqqqqqwqqqqqwqqqqqqqqqqqqwqqqqqqqqqqqqqqqk
x Name x Latest x Age x Downloaded x Identified By x
mqqqqqqvqqqqqqqqvqqqqqvqqqqqqqqqqqqvqqqqqqqqqqqqqqqj
Use `flexget series show NAME` to get detailed information
```

Like the helpful note on how to get more detailed information, a similar note could be added on the three available filters ('configured', 'unconfigured', 'all'). This message could be made conditional on the list being empty.

Additionally the output could lead with which filter the list is shown to begin with. Something like: 
```shell
$ flexget series list {,unconfigured,configured,all}
{Unconfigured,Configured,All} series are:
lqqqqqqwqqqqqqqqwqqqqqwqqqqqqqqqqqqwqqqqqqqqqqqqqqqk
x Name x Latest x Age x Downloaded x Identified By x
mqqqqqqvqqqqqqqqvqqqqqvqqqqqqqqqqqqvqqqqqqqqqqqqqqqj
Use `flexget series show NAME` to get detailed information
Use `flexget series FILTER` to use different filter
```

### Additional information:

- Flexget Version: 2.10.10
- Python Version: 3.5.2
- Installation method: pip3
- OS and version: Ubuntu 16.04


Discussion:
Would you mind assigning this one to me? Seems like something I can do and ease me into the project. Same for https://github.com/Flexget/Flexget/issues/1724 actually. I'll work on it beginning of next week.
Just post a pr then

Resolving patch:
diff --git a/flexget/plugins/cli/series.py b/flexget/plugins/cli/series.py
--- a/flexget/plugins/cli/series.py
+++ b/flexget/plugins/cli/series.py
@@ -71,7 +71,7 @@ def display_summary(options):
         for index, value in enumerate(header):
             if value.lower() == options.sort_by:
                 header[index] = colorize(SORT_COLUMN_COLOR, value)
-        footer = 'Use `flexget series show NAME` to get detailed information'
+
         table_data = [header]
         for series in query:
             name_column = series.name
@@ -109,7 +109,10 @@ def display_summary(options):
         console('ERROR: %s' % str(e))
         return
     if not porcelain:
-        console(footer)
+        if not query.count():
+            console('Use `flexget series list all` to view all known series.')
+        else:
+            console('Use `flexget series show NAME` to get detailed information.')
 
 
 def begin(manager, options):


Test patch:
Repository: Flexget/Flexget

Issue:
next_series_* does not take task series config into account when determining identified_by
### Expected behaviour:
A series in the database that has an 'identified by' type of 'auto' will still be recognized as 'ep' type when it is configured as 'ep' with ``series`` (or ``configure_series``) setting ``identified_by`` in the task.

### Actual behaviour:
The settings in the task series config are ignored and the series is rejected due to 'auto' identified by type.

### Steps to reproduce:
- Step 1: 
```
flexget inject "My Show S01E01 720p hdtv h264 dd5.1" --tasks learn_eps --learn --force --disable-tracking
```
- Step 2: Run test_task.

#### Config:
```
  learn_eps:
    all_series:
      season_packs: always
    manual: yes

  test_task:
    series:
      - My Show:
          identified_by: ep
    discover:
      what:
        - next_series_seasons:
      from:
        - btn: 'blah'
```
  
#### Log:
```
2017-04-10 03:03 TRACE    next_series_seasons test_task evaluating My Show
2017-04-10 03:03 TRACE    next_series_seasons test_task unsupported identified_by scheme
2017-04-10 03:03 VERBOSE  next_series_seasons test_task Series `My Show` with identified_by value `auto` are not supported.
```

### Additional information:

- Flexget Version: 2.10.30
- Python Version: 2.7.13
- Installation method: pip
- OS and version: macOS El Capitan 10.11.6
- Link to crash log: n/a


Discussion:
Hmm, I think this is happens when series has no begin or previously downloaded eps? 
In my case there was 1 episode, but it was still auto, so basically yeah. But if you explicitly tell it to treat it as ep via config, then ``next_series_*`` should account for that, no?

Resolving patch:
diff --git a/flexget/plugins/filter/series.py b/flexget/plugins/filter/series.py
--- a/flexget/plugins/filter/series.py
+++ b/flexget/plugins/filter/series.py
@@ -1174,6 +1174,8 @@ def populate_entry_fields(entry, parser, config):
     entry['series_episodes'] = parser.episodes
     entry['series_id'] = parser.pack_identifier
     entry['series_id_type'] = parser.id_type
+    entry['series_identified_by'] = parser.identified_by
+    entry['series_exact'] = parser.strict_name
 
     # If a config is passed in, also look for 'path' and 'set' options to set more fields
     if config:


Test patch:
Repository: Flexget/Flexget

Issue:
Letterboxd plugin does not paginate correctly
### Expected behaviour:

When using a letterboxd list as input, lists with more than 100 entries should produce more than 100 entries in flexget.

### Actual behaviour:

Letterboxd input is only able to generate <=100 entries.

### Steps to reproduce:
- Step 1: Configure a letterboxd input for a list that contains > 100 entries
- Step 2: Run task and note that only 100 entries are generated.

### Additional information:

I see the problem:

https://github.com/Flexget/Flexget/blob/83bc8dc86fd4760c4f059353975a24e04e681888/flexget/plugins/input/letterboxd.py#L137

The actual markup on page is (as of this writing):

```html
<div class="paginate-nextprev">
  <a class="next" href="/usrid/list/listname/page/pagenum/">Next</a>
</div>
```

So the query should actually be '.paginate-nextprev .next' not '.paginate-next'. I'm assuming they changed their site. 


Discussion:

Resolving patch:
diff --git a/flexget/plugins/input/letterboxd.py b/flexget/plugins/input/letterboxd.py
--- a/flexget/plugins/input/letterboxd.py
+++ b/flexget/plugins/input/letterboxd.py
@@ -134,7 +134,7 @@ def on_task_input(self, task, config=None):
                     if 'max_results' in config:
                         rcount += 1
 
-            next_page = soup.find(class_='paginate-next')
+            next_page = soup.select_one('.paginate-nextprev .next')
             if next_page is not None:
                 next_page = next_page.get('href')
                 if next_page is not None:


Test patch:
Repository: Flexget/Flexget

Issue:
Torrentday Seeders and Leechers Causes an Error.
  File "/usr/local/flexget/env/lib/python2.7/site-packages/flexget/plugins/sites/torrentday.py", line 174, in search
    entry['torrent_seeds'] = int(seeders.contents[0].replace(',', ''))
  File "/usr/local/flexget/env/lib/python2.7/site-packages/bs4/element.py", line 1807, in __getattr__
    "ResultSet object has no attribute '%s'. You're probably treating a list of items like a single item. Did you call find_all() when you meant to call find()?" % key
AttributeError: ResultSet object has no attribute 'contents'. You're probably treating a list of items like a single item. Did you call find_all() when you meant to call find()?
2018-12-08 16:01 WARNING  task          AVI2MKV         Aborting task (plugin: discover)
2018-12-08 16:01 DEBUG    task_queue                    task AVI2MKV aborted: TaskAbort(reason=BUG: Unhandled error in plugin discover: ResultSet object has no attribute 'contents'. You're probably treating a list of items like a single item. Did you call find_all() when you meant to call find()?, silent=False)



Discussion:

Resolving patch:
diff --git a/flexget/plugins/sites/torrentday.py b/flexget/plugins/sites/torrentday.py
--- a/flexget/plugins/sites/torrentday.py
+++ b/flexget/plugins/sites/torrentday.py
@@ -136,9 +136,15 @@ def search(self, task, entry, config=None):
             except RequestException as e:
                 raise PluginError('Could not connect to torrentday: {}'.format(e))
 
-            soup = get_soup(page)
+            # the following should avoid table being None due to a malformed
+            # html in td search results
+            soup = get_soup(page).contents[1].contents[1].next.next.nextSibling
+            table = soup.find('table', {'id': 'torrentTable'})
+            if (table is None):
+                raise PluginError('Search returned by torrentday appears to be empty or malformed.')
+
             # the first row is the header so skip it
-            for tr in soup.find_all('tr')[1:]:
+            for tr in table.find_all('tr')[1:]:
                 entry = Entry()
                 # find the torrent names
                 td = tr.find('td', { 'class': 'torrentNameInfo' })
@@ -165,8 +171,8 @@ def search(self, task, entry, config=None):
                 entry['url'] = torrent_url
 
                 # us tr object for seeders/leechers
-                seeders = tr.find_all('td', { 'class': 'ac seedersInfo'})
-                leechers = tr.find_all('td', { 'class': 'ac leechersInfo'})
+                seeders = tr.find('td', { 'class': 'ac seedersInfo'})
+                leechers = tr.find('td', { 'class': 'ac leechersInfo'})
                 entry['torrent_seeds'] = int(seeders.contents[0].replace(',', ''))
                 entry['torrent_leeches'] = int(leechers.contents[0].replace(',', ''))
                 entry['search_sort'] = torrent_availability(entry['torrent_seeds'], entry['torrent_leeches'])


Test patch:
Repository: Flexget/Flexget

Issue:
rutracker does not work because of nonexisting mirror
In file: flexget/components/sites/sites/rutracker.py
Listed mirrors:

MIRRORS = ['https://rutracker.cr', 'https://rutracker.net', 'https://rutracker.org']

https://rutracker.cr no longer works and plugin cannot connect. Plugin chekcs if mirros is up, and this site is up, just no longer mirrors rutracker.

Change it to:

MIRRORS = ['https://rutracker.net', 'https://rutracker.org']

rutracker does not work because of nonexisting mirror
In file: flexget/components/sites/sites/rutracker.py
Listed mirrors:

MIRRORS = ['https://rutracker.cr', 'https://rutracker.net', 'https://rutracker.org']

https://rutracker.cr no longer works and plugin cannot connect. Plugin chekcs if mirros is up, and this site is up, just no longer mirrors rutracker.

Change it to:

MIRRORS = ['https://rutracker.net', 'https://rutracker.org']



Discussion:

Resolving patch:
diff --git a/flexget/components/sites/sites/rutracker.py b/flexget/components/sites/sites/rutracker.py
--- a/flexget/components/sites/sites/rutracker.py
+++ b/flexget/components/sites/sites/rutracker.py
@@ -25,7 +25,7 @@
 log = logging.getLogger('rutracker_auth')
 Base = versioned_base('rutracker_auth', 0)
 
-MIRRORS = ['https://rutracker.cr', 'https://rutracker.net', 'https://rutracker.org']
+MIRRORS = ['https://rutracker.net', 'https://rutracker.org']
 
 
 class JSONEncodedDict(TypeDecorator):


Test patch:
Repository: Flexget/Flexget

Issue:
Dependencies on non pure Python modules
Hi,

Sorry for [x-posting](https://discuss.flexget.com/t/dependencies-on-non-pure-python-modules/5086). This is kind of a development issue so it might fit here better than in the forum. Feel free to just close this and reply on Discourse.

When upgrading Flexget I stumbled upon the fact that now it depends on Pillow, as per:

https://github.com/Flexget/Flexget/pull/2621

My Flexget runs on an embedded aarch64 device so every time you add a dep on a module that links against C libraries (Pillow depends on zlib and libjpeg) I have to cross compile the necessary native extensions, distribute them etc. Either that or manually installing a skimmed `requirements.txt` and finally installing Flexget passing `--no-dependencies` to `pip install`.

Does adding a tray icon justify this hassle for users? No saying that’s wrong of course, just trying to bring to your attention this use case and the potential annoyance for users.

Could perhaps these things be made optional at install/build time by relaxing the hard dependency?

Thanks.
Dependencies on non pure Python modules
Hi,

Sorry for [x-posting](https://discuss.flexget.com/t/dependencies-on-non-pure-python-modules/5086). This is kind of a development issue so it might fit here better than in the forum. Feel free to just close this and reply on Discourse.

When upgrading Flexget I stumbled upon the fact that now it depends on Pillow, as per:

https://github.com/Flexget/Flexget/pull/2621

My Flexget runs on an embedded aarch64 device so every time you add a dep on a module that links against C libraries (Pillow depends on zlib and libjpeg) I have to cross compile the necessary native extensions, distribute them etc. Either that or manually installing a skimmed `requirements.txt` and finally installing Flexget passing `--no-dependencies` to `pip install`.

Does adding a tray icon justify this hassle for users? No saying that’s wrong of course, just trying to bring to your attention this use case and the potential annoyance for users.

Could perhaps these things be made optional at install/build time by relaxing the hard dependency?

Thanks.


Discussion:
I totally agree that the tray icon does not justify this hassle. I'll make the neccesary changes.
I totally agree that the tray icon does not justify this hassle. I'll make the neccesary changes.

Resolving patch:
diff --git a/flexget/tray_icon.py b/flexget/tray_icon.py
--- a/flexget/tray_icon.py
+++ b/flexget/tray_icon.py
@@ -17,7 +17,7 @@
 
     _import_success = True
 except Exception as e:
-    logger.debug('Could not import pystray: {}', e)
+    logger.debug('Could not load tray icon: {}', e)
     _import_success = False
 
 


Test patch: