Repository: Flexget/Flexget

Issue:
Error downloading from newpct - "maybe a login page"
<!---
Before opening an issue, verify:

- Is this a feature request? Post it on https://feathub.com/Flexget/Flexget
- Did you recently upgrade? Look at the Change Log and Upgrade Actions to make sure that you don't need to make any changes to your config https://flexget.com/ChangeLog https://flexget.com/UpgradeActions
- Are you running FlexGet as a daemon? Stop it completely and then start it again https://flexget.com/CLI/daemon
- Did you search to see if the issue already exists? https://github.com/Flexget/Flexget/issues
- Did you fill out the issue template as completely as possible?

The issue template is here because it helps to ensure you submitted all the necessary information the first time, and allows us to more quickly review issues. Please fill it out correctly and do not ignore it, no matter how irrelevant you think it may be. Thanks in advance for your help with this!
--->
### Expected behaviour:
Download last episodes from my series from newpct feed.

### Actual behaviour:
Download from newpct is not working. I get this message: "maybe a login page?" 2 weeks ago it was working.

### Steps to reproduce:
- Step 1: flexget execute

#### Config:
```
tasks:
  series_sigo:
    rss: http://feeds2.feedburner.com/newpctorrent
    regexp:
      reject:
        - V.O. Subt. Castellano
    series:
      settings:
        calidadnormal:
          sequence_regexp: Cap.(\d+)
          quality: <720p
        calidadhd:
          sequence_regexp: Cap.(\d+)
          quality: 720p+
      calidadhd:
        - The Walking Dead
        - Prison Break
        - Mentes Criminales
    transmission:
      host: 192.168.1.60
      port: 9091
      ratio: 50
      path: /media/TOSHIBA/Series/{{series_name}}
      username: myUserName
      password: myPassword
      skip_files:
        - '*.nfo'
        - '*.sfv'
        - '[sS]ample*'
        - '*.txt'
        - '*.url'
        - '*.html'
        - '*.htm'
```
  
#### Log:
```
2017-05-31 15:25 VERBOSE  details       series_sigo     Produced 263 entries.2017-05-31 15:25 VERBOSE  task          series_sigo     REJECTED: `Prison Break - Temporada 5 [HDTV 720p][Cap.504][AC3 5.1 Español Castellano]` by retry_failed plugin because has already failed 4 times in the past. (failure reason: Unexpected html content received from `http://www.newpct.com/torrents/344829.torrent` - maybe a login page?)
2017-05-31 15:25 VERBOSE  task          series_sigo     REJECTED: `Mentes Criminales - Temporada 12 [HDTV 720p][Cap.1221][AC3 5.1 Español Castellano]` by retry_failed plugin because has already failed 4 times in the past. (failure reason: Unexpected html content received from `http://www.newpct.com/torrents/344829.torrent` - maybe a login page?)
```

### Additional information:

- FlexGet version: 2.10.56
- Python version: 2.7.9
- Installation method: pip repository (also tried github install with virtualenv, from develop and same result)
- Using daemon (yes/no):
- OS and version: Raspbian on raspberry pi 3

<!---
In config and debug/crash logs, remember to redact any personal or sensitive information such as passwords, API keys, private URLs and so on.

Please verify that the following data is present before submitting your issue:

- Link to a paste service or paste above the relevant config (preferably full config, including templates if present). Please make sure the paste does not expire, if possible.
- Link to a paste service or paste above debug-level logs of the relevant task/s (use `flexget -L debug execute --tasks <Task_name>`).
- FlexGet version (use `flexget -V` to get it).
- Full Python version, for example `2.7.11` (use `python -V` to get it). Note that FlexGet is not supported for use with Python v3.0, 3.1, 3.2 or 3.6.
- Installation method (pip, git install, etc).
- Whether or not you're running FlexGet as a daemon.
- OS and version.
- Attach crash log if one was generated, in addition to the debug-level log. It can be found in the directory with your config file.
--->



Discussion:

Resolving patch:
diff --git a/flexget/utils/imdb.py b/flexget/utils/imdb.py
--- a/flexget/utils/imdb.py
+++ b/flexget/utils/imdb.py
@@ -270,8 +270,8 @@ def parse(self, imdb_id):
             else:
                 log.warning('Unable to get votes for %s - plugin needs update?' % url)
 
-            # get score
-            span_score = soup.find(itemprop='ratingValue')
+            # get score - find the ratingValue item that contains a numerical value
+            span_score = soup.find(itemprop='ratingValue', text=re.compile('[\d\.]+'))
             if span_score:
                 try:
                     self.score = float(span_score.string)
@@ -286,7 +286,7 @@ def parse(self, imdb_id):
             self.genres.append(link.text.lower())
 
         # get languages
-        for link in soup.find_all('a', attrs={'itemprop': 'inLanguage'}):
+        for link in soup.find_all('a', href=re.compile('/language/.*')):
             # skip non-primary languages "(a few words)", etc.
             m = re.search('(?x) \( [^()]* \\b few \\b', link.next_sibling)
             if not m:


Test patch: