Repository: Flexget/Flexget

Issue:
Flexget+guessit=wrong quality.source
### Expected behaviour:
Recognize release with "webrip" in title as webrip

### Actual behaviour:
Release parsed as web-dl. Standalone guessit returns webrip.

### Steps to reproduce:
- Step 1: Grab any webrip

#### Config:
```
tasks:
  test_parser:
    mock:
      - {title: 'The.Walking.Dead.S09E13.Chokepoint.1080p.AMZN.WEBRip.DDP5.1.x264-CasStudio[rartv]'}
    series:
      - The Walking Dead
    parsing:
      series: guessit
```
#### Log:
<details>
 <summary>(click to expand)</summary>

```
2019-03-11 15:34 INFO     manager                       Test mode, creating a copy from database ...
2019-03-11 15:34 VERBOSE  manager                       Creating new database /Users/edit/.flexget/test-test3.sqlite - DO NOT INTERUPT ...
2019-03-11 15:34 VERBOSE  task_queue                    There are 1 tasks to execute. Shutdown will commence when they have completed.
2019-03-11 15:34 VERBOSE  details       test_parser     Produced 1 entries.
2019-03-11 15:34 VERBOSE  flexget.components.series.series test_parser     Found different quality for `The.Walking.Dead.S09E13.Chokepoint.1080p.WEBRip.DDP5.1.x264-CasStudio[rartv]`. Was `1080p webrip h264 dd+5.1`, overriding with `1080p webdl h264 dd+5.1`.
2019-03-11 15:34 VERBOSE  series.db     test_parser     identified by is currently on `auto` for The Walking Dead. Multiple id types may be accepted until it locks in on the appropriate type.
2019-03-11 15:34 VERBOSE  task          test_parser     ACCEPTED: `The.Walking.Dead.S09E13.Chokepoint.1080p.WEBRip.DDP5.1.x264-CasStudio[rartv]` by series plugin because choosing best available quality
2019-03-11 15:34 VERBOSE  details       test_parser     Summary - Accepted: 1 (Rejected: 0 Undecided: 0 Failed: 0)
2019-03-11 15:34 WARNING  task          test_parser     Task doesn't have any output plugins, you should add (at least) one!
-- Accepted: ---------------------------
title            : The.Walking.Dead.S09E13.Chokepoint.1080p.WEBRip.DDP5.1.x264-CasStudio[rartv]
url              : mock://localhost/mock/-7343637289710024328
original_url     : mock://localhost/mock/-7343637289710024328
accepted_by      : series
id               : the walking dead s09e13
original_title   : The.Walking.Dead.S09E13.Chokepoint.1080p.WEBRip.DDP5.1.x264-CasStudio[rartv]
proper           : False
proper_count     : 0
quality          : 1080p webdl h264 dd+5.1
reason           : choosing best available quality
release_group    : CasStudio[rartv]
season_pack      : False
series_episode   : 13
series_episodes  : 1
series_exact     : False
series_id        : S09E13
series_id_type   : ep
series_identified_by: auto
series_name      : The Walking Dead
series_parser    : <SeriesParseResult(data=The.Walking.Dead.S09E13.Chokepoint.1080p.WEBRip.DDP5.1.x264-CasStudio[rartv],name=The Walking Dead,id=(9, 13),season=9,season_pack=False,episode=13,quality=1080p webdl h264 dd+5.1,proper=0,special=False,status=OK)>
series_releases  : [1]
series_season    : 9
task             : test_parser

```
</details>

#### Guessit Log:
<details>
 <summary>(click to expand)</summary>

```
For: The.Walking.Dead.S09E13.Chokepoint.1080p.AMZN.WEBRip.DDP5.1.x264-CasStudio[rartv]
GuessIt found: {
    "title": "The Walking Dead", 
    "season": 9, 
    "episode": 13, 
    "episode_title": "Chokepoint", 
    "screen_size": "1080p", 
    "streaming_service": "Amazon Prime", 
    "source": "Web", 
    "other": "Rip", 
    "audio_codec": "Dolby Digital Plus", 
    "audio_channels": "5.1", 
    "video_codec": "H.264", 
    "release_group": "CasStudio[rartv]", 
    "type": "episode"
}
```
</details>

### Additional information:

- FlexGet version: 2.20.11
- Python version: 2.7.15 / 3.6.7
- Installation method: global
- Using daemon (yes/no): yes
- OS and version: macOS 10.12.6 / Ubuntu 18.04.2
- Link to crash log:

<!---
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.
--->

Flexget+guessit=wrong quality.source
### Expected behaviour:
Recognize release with "webrip" in title as webrip

### Actual behaviour:
Release parsed as web-dl. Standalone guessit returns webrip.

### Steps to reproduce:
- Step 1: Grab any webrip

#### Config:
```
tasks:
  test_parser:
    mock:
      - {title: 'The.Walking.Dead.S09E13.Chokepoint.1080p.AMZN.WEBRip.DDP5.1.x264-CasStudio[rartv]'}
    series:
      - The Walking Dead
    parsing:
      series: guessit
```
#### Log:
<details>
 <summary>(click to expand)</summary>

```
2019-03-11 15:34 INFO     manager                       Test mode, creating a copy from database ...
2019-03-11 15:34 VERBOSE  manager                       Creating new database /Users/edit/.flexget/test-test3.sqlite - DO NOT INTERUPT ...
2019-03-11 15:34 VERBOSE  task_queue                    There are 1 tasks to execute. Shutdown will commence when they have completed.
2019-03-11 15:34 VERBOSE  details       test_parser     Produced 1 entries.
2019-03-11 15:34 VERBOSE  flexget.components.series.series test_parser     Found different quality for `The.Walking.Dead.S09E13.Chokepoint.1080p.WEBRip.DDP5.1.x264-CasStudio[rartv]`. Was `1080p webrip h264 dd+5.1`, overriding with `1080p webdl h264 dd+5.1`.
2019-03-11 15:34 VERBOSE  series.db     test_parser     identified by is currently on `auto` for The Walking Dead. Multiple id types may be accepted until it locks in on the appropriate type.
2019-03-11 15:34 VERBOSE  task          test_parser     ACCEPTED: `The.Walking.Dead.S09E13.Chokepoint.1080p.WEBRip.DDP5.1.x264-CasStudio[rartv]` by series plugin because choosing best available quality
2019-03-11 15:34 VERBOSE  details       test_parser     Summary - Accepted: 1 (Rejected: 0 Undecided: 0 Failed: 0)
2019-03-11 15:34 WARNING  task          test_parser     Task doesn't have any output plugins, you should add (at least) one!
-- Accepted: ---------------------------
title            : The.Walking.Dead.S09E13.Chokepoint.1080p.WEBRip.DDP5.1.x264-CasStudio[rartv]
url              : mock://localhost/mock/-7343637289710024328
original_url     : mock://localhost/mock/-7343637289710024328
accepted_by      : series
id               : the walking dead s09e13
original_title   : The.Walking.Dead.S09E13.Chokepoint.1080p.WEBRip.DDP5.1.x264-CasStudio[rartv]
proper           : False
proper_count     : 0
quality          : 1080p webdl h264 dd+5.1
reason           : choosing best available quality
release_group    : CasStudio[rartv]
season_pack      : False
series_episode   : 13
series_episodes  : 1
series_exact     : False
series_id        : S09E13
series_id_type   : ep
series_identified_by: auto
series_name      : The Walking Dead
series_parser    : <SeriesParseResult(data=The.Walking.Dead.S09E13.Chokepoint.1080p.WEBRip.DDP5.1.x264-CasStudio[rartv],name=The Walking Dead,id=(9, 13),season=9,season_pack=False,episode=13,quality=1080p webdl h264 dd+5.1,proper=0,special=False,status=OK)>
series_releases  : [1]
series_season    : 9
task             : test_parser

```
</details>

#### Guessit Log:
<details>
 <summary>(click to expand)</summary>

```
For: The.Walking.Dead.S09E13.Chokepoint.1080p.AMZN.WEBRip.DDP5.1.x264-CasStudio[rartv]
GuessIt found: {
    "title": "The Walking Dead", 
    "season": 9, 
    "episode": 13, 
    "episode_title": "Chokepoint", 
    "screen_size": "1080p", 
    "streaming_service": "Amazon Prime", 
    "source": "Web", 
    "other": "Rip", 
    "audio_codec": "Dolby Digital Plus", 
    "audio_channels": "5.1", 
    "video_codec": "H.264", 
    "release_group": "CasStudio[rartv]", 
    "type": "episode"
}
```
</details>

### Additional information:

- FlexGet version: 2.20.11
- Python version: 2.7.15 / 3.6.7
- Installation method: global
- Using daemon (yes/no): yes
- OS and version: macOS 10.12.6 / Ubuntu 18.04.2
- Link to crash log:

<!---
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/components/parsing/parsers/parser_guessit.py b/flexget/components/parsing/parsers/parser_guessit.py
--- a/flexget/components/parsing/parsers/parser_guessit.py
+++ b/flexget/components/parsing/parsers/parser_guessit.py
@@ -121,7 +121,7 @@ def _source(self, guessit_result):
         other = normalize_component(guessit_result.get('other'))
         source = self.SOURCE_MAP.get(guessit_result.get('source'), guessit_result.get('source'))
         # special case
-        if source == 'web-dl' and 'Rip' in other:
+        if source == 'web-dl' and 'rip' in other:
             source = 'webrip'
 
         source = normalize_component(source)


Test patch: