Repository: Flexget/Flexget

Issue:
"web" is ignored as a quality
### Expected behaviour:

quality should be parsed as webrip
### Actual behaviour:

quality is parsed as '720p h264'
### Steps to reproduce:
- Step 1: ...

`flexget inject 'Powers.US.S02E01.720p.WEB.h264-DEFEATER' --task tv --dump`
#### Config:

```
series:
  tv:
    - Powers: {quality: <1080p webrip+}
```
#### Log:

```
2016-06-01 14:18 VERBOSE  series        tv             Ignored `Powers.US.S02E01.720p.WEB.h264-DEFEATER`. Does not meet quality requirement `<1080p webrip+`.

-- Undecided: --------------------------
title            : Powers.US.S02E01.720p.WEB.h264-DEFEATER
url              : http://localhost/inject/Gj8wRPBIkxmcu9gTtl3N2WYVzif5SL
original_url     : http://localhost/inject/Gj8wRPBIkxmcu9gTtl3N2WYVzif5SL
path             : ~/video/series/Powers/
proper           : False
proper_count     : 0
quality          : 720p h264
release_group    : None
series_episode   : 1
series_episodes  : 1
series_id        : S02E01
series_id_type   : ep
series_name      : Powers
series_parser    : <SeriesParser(data=Powers.US.S02E01.720p.WEB.h264-DEFEATER,name=Powers,id=None,season=2,episode=1,quality=720p h264,proper=0,status=OK)>
series_releases  : [91146]
series_season    : 2
task             : tv
```
### Additional information:
- Flexget Version: 2.0.38
- Python Version: 2.7.11
- Installation method: git
- OS and version: OS X



Discussion:
As  you can see from here: http://flexget.com/wiki/Qualities
there is no "web" quality, only "webrip" or "webdl" - how is flexget supposed to know which of these two the release group meant if they only tag it as "web"?

In my opinion, it's the group's fault, not flexget's.

"web" should map to the lowest possible choice, so it should map to "webrip". It's not like this was an uncommon mistake by a single group, "web" is used a lot by many groups. So it should be handled. Or there should at least be a way for users to create custom qualities without having to resort to an inaccurate use of the manipulate plugin.

FYI WEB is the Scene's equivalent  to the p2p groups web-dl naming. In case you don't know.  

But most of the groups that use WEB are not part of the scene and they use it for webrip quality. You can see here that most of the WEB torrents are webrips:
https://kat.cr/usearch/%22web%22%20-webdl%20-%22web%20dl%22%20-webrip%20category%3Atv/2/

On a related note, I did just stumble across one I hadn't seen before: WEBCAP. That's clearly webrip quality and flexget doesn't handle that one.

All the ones i see there except the one group with the x265 releases are scene

This should be recognized as `webrip`. Pushing a fix now.

I rushed the fix, need to fix a bunch more stuff to do this properly...

any word on this?

A much needed touch up to entire qualities module is planned, this will be a part of that 

is there a ticket for that project so we can follow it? would like to know how long we have to manually download the shows that have this issue.


Resolving patch:
diff --git a/flexget/plugins/api_t411.py b/flexget/plugins/api_t411.py
--- a/flexget/plugins/api_t411.py
+++ b/flexget/plugins/api_t411.py
@@ -149,7 +149,7 @@ def add_episode_term(self, episode):
     1174: qualities.get("webdl 1080p"),
     1182: qualities.get("webdl"),
     1175: qualities.get("webdl 720p"),
-    19: qualities.get("webrip")
+    19: qualities.get("webdl")
 }
 
 def auth_required(func):
diff --git a/flexget/utils/qualities.py b/flexget/utils/qualities.py
--- a/flexget/utils/qualities.py
+++ b/flexget/utils/qualities.py
@@ -138,14 +138,13 @@ def __deepcopy__(self, memo=None):
     QualityComponent('source', 90, 'tvrip', 'tv[\W_]?rip'),
     QualityComponent('source', 100, 'dsr', 'dsr|ds[\W_]?rip'),
     QualityComponent('source', 110, 'sdtv', '(?:[sp]dtv|dvb)(?:[\W_]?rip)?'),
-    QualityComponent('source', 120, 'webrip', 'web[\W_]?rip'),
-    QualityComponent('source', 130, 'dvdscr', '(?:(?:dvd|web)[\W_]?)?scr(?:eener)?', modifier=0),
-    QualityComponent('source', 140, 'bdscr', 'bdscr(?:eener)?'),
-    QualityComponent('source', 150, 'hdtv', 'a?hdtv(?:[\W_]?rip)?'),
-    QualityComponent('source', 160, 'webdl', 'web(?:[\W_]?(dl|hd))'),
-    QualityComponent('source', 170, 'dvdrip', 'dvd(?:[\W_]?rip)?'),
-    QualityComponent('source', 175, 'remux'),
-    QualityComponent('source', 180, 'bluray', '(?:b[dr][\W_]?rip|blu[\W_]?ray(?:[\W_]?rip)?)')
+    QualityComponent('source', 120, 'dvdscr', '(?:(?:dvd|web)[\W_]?)?scr(?:eener)?', modifier=0),
+    QualityComponent('source', 130, 'bdscr', 'bdscr(?:eener)?'),
+    QualityComponent('source', 140, 'hdtv', 'a?hdtv(?:[\W_]?rip)?'),
+    QualityComponent('source', 150, 'webdl', 'web|web(?:[\W_]?(dl|hd|rip))'),
+    QualityComponent('source', 160, 'dvdrip', 'dvd(?:[\W_]?rip)?'),
+    QualityComponent('source', 165, 'remux'),
+    QualityComponent('source', 170, 'bluray', '(?:b[dr][\W_]?rip|blu[\W_]?ray(?:[\W_]?rip)?)')
 ]
 _codecs = [
     QualityComponent('codec', 10, 'divx'),


Test patch:
diff --git a/tests/test_qualities.py b/tests/test_qualities.py
--- a/tests/test_qualities.py
+++ b/tests/test_qualities.py
@@ -29,6 +29,7 @@ def parser(self, request):
             return ParserGuessit
 
     @pytest.mark.parametrize("test_quality", [
+        ('Test.File 1080p.web', '1080p webdl'),
         ('Test.File 1080p.web-dl', '1080p webdl'),
         ('Test.File.web-dl.1080p', '1080p webdl'),
         ('Test.File.WebHD.720p', '720p webdl'),
@@ -48,6 +49,8 @@ def parser(self, request):
         ('Test.File.1080p.10bit', '1080p 10bit'),
         ('Test.File.1080p.bluray.10bit', '1080p bluray 10bit'),
 
+        ('Test.File.720p.webrip', '720p webdl'),
+        ('Test.File.720p.web', '720p webdl'),
         ('Test.File.720p.webdl', '720p webdl'),
         ('Test.File.1280x720_web dl', '720p webdl'),
         ('Test.File.720p.h264.web.dl', '720p webdl h264'),