lad1337 / Sick-Beard

PVR & episode guide that downloads and manages all your TV shows
http://code.google.com/p/sickbeard/
GNU General Public License v3.0
70 stars 26 forks source link

fail to process TypeError: %d format: a number is required, not NoneType #19

Open orangepeelbeef opened 10 years ago

orangepeelbeef commented 10 years ago

2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last): File "/usr/local/sickbeard/cherrypy/_cprequest.py", line 660, in respond response.body = self.handler() File "/usr/local/sickbeard/cherrypy/lib/encoding.py", line 193, in call self.body = self.oldhandler(_args, _kwargs) File "/usr/local/sickbeard/cherrypy/_cpdispatch.py", line 25, in call return self.callable(_self.args, _self.kwargs) File "/usr/local/sickbeard/sickbeard/webserve.py", line 1609, in processEpisode result = processTV.processDir(dir, nzbName) File "/usr/local/sickbeard/sickbeard/processTV.py", line 108, in processDir process_result = processor.process() File "/usr/local/sickbeard/sickbeard/postProcessor.py", line 777, in process proper_path = ep_obj.proper_path() File "/usr/local/sickbeard/sickbeard/tv.py", line 1859, in proper_path result = self.formatted_filename() File "/usr/local/sickbeard/sickbeard/tv.py", line 1908, in formatted_filename return self._format_pattern(name_groups[-1], multi) File "/usr/local/sickbeard/sickbeard/tv.py", line 1735, in _format_pattern replace_map = self._replace_map() File "/usr/local/sickbeard/sickbeard/tv.py", line 1692, in _replace_map '%A': '%03d' % self.absolute_number, TypeError: %d format: a number is required, not NoneType

orangepeelbeef commented 10 years ago

Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Processing folder /opt/downloads/incoming/2.Broke.girls Sep-26 13:15:10 DEBUG CP Server Thread-4 :: sickbeard.db: SELECT * FROM tv_shows Sep-26 13:15:10 INFO CP Server Thread-4 :: Processing /opt/downloads/incoming/2.Broke.girls/2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv (None) Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Attempting to pp by analysing the: file name Sep-26 13:15:10 INFO CP Server Thread-4 :: Analyzing name u'2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv' Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Parser for '2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv' locked. Starting to parse now Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Using ANIME regexs Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Using cached parse result for: 2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Trying to get the tvdbid for 2 Broke Girls Sep-26 13:15:10 DEBUG CP Server Thread-4 :: cache.db: SELECT * FROM scene_names WHERE name = ? with args [u'broke.girls'] Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Found broke girls in the exception list Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Using NORMAL regexs Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Using cached parse result for: 2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Trying to get the tvdbid for 2 Broke Girls Sep-26 13:15:10 DEBUG CP Server Thread-4 :: cache.db: SELECT * FROM scene_names WHERE name = ? with args [u'broke.girls'] Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Found broke girls in the exception list Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Parsed :2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv into: 2 Broke Girls - S3E1 absolute_numbers: [720] [ABD: False] [ANIME: True] [whichReg: ['anime_and_normal']] Sep-26 13:15:10 DEBUG CP Server Thread-4 :: This looks like a scene release converting numbers Sep-26 13:15:10 DEBUG CP Server Thread-4 :: cache.db: SELECT tvdb_id, season FROM scene_exceptions WHERE LOWER(show_name) = ? ORDER BY season ASC with args [u'2 broke girls'] Sep-26 13:15:10 DEBUG CP Server Thread-4 :: cache.db: SELECT show_name, tvdb_id, season FROM scene_exceptions Sep-26 13:15:10 DEBUG CP Server Thread-4 :: possible seasons for '2 Broke Girls' (248741) are [] Sep-26 13:15:10 DEBUG CP Server Thread-4 :: '2 Broke Girls' is a normal show i will scene convert the season and episodes 3x[1] Sep-26 13:15:10 DEBUG CP Server Thread-4 :: sickbeard.db: SELECT season, episode, name FROM tv_episodes WHERE showid = ? and scene_episode = ? and scene_season = ? with args [248741, 1, 3] Sep-26 13:15:10 DEBUG CP Server Thread-4 :: No episode found for these scene numbers. assuming these are valid tvdb numbers Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Loading show object for tvdb_id 248741 Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Retrieving episode object for 3x1 Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Looking up quality for name 2.Broke.girls, got Unknown Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Looking up quality for name 2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv, got HD TV Sep-26 13:15:10 DEBUG CP Server Thread-4 :: 2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv looks like it has quality HD TV, using that Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Quality of the episode we're processing: 4 Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Is ep a priority download: False Sep-26 13:15:10 DEBUG CP Server Thread-4 :: File /opt/downloads/TV/2 Broke Girls/Two.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv doesn't exist so there's no worries about replacing it Sep-26 13:15:10 DEBUG CP Server Thread-4 :: Deleting file /opt/downloads/TV/2 Broke Girls/Two.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv Sep-26 13:15:10 INFO CP Server Thread-4 :: Trying to clean any empty folders under /opt/downloads/TV/2 Broke Girls Sep-26 13:15:10 DEBUG CP Server Thread-4 :: good results: {1: False, 2: False, 3: False} Sep-26 13:15:10 DEBUG CP Server Thread-4 :: 248741: Saving episode details to database Sep-26 13:15:10 DEBUG CP Server Thread-4 :: STATUS IS Downloaded (HD TV) Sep-26 13:15:10 DEBUG CP Server Thread-4 :: sickbeard.db: UPDATE tv_episodes SET status = ?, description = ?, airdate = ?, hastbn = ?, scene_episode = ?, file_size = ?, name = ?, tvdbid = ?, scene_season = ?, location = ?, absolute_number = ?, scene_absolute_number = ?, release_name = ?, hasnfo = ? WHERE season = ? AND showid = ? AND episode = ? with args [404, u"Word about a shocking incident involving a celebrity brings customers to Max and Caroline's new cupcake window.", 735134, False, None, 772208838, u'And the Soft Opening', 4595689, None, u'/opt/downloads/TV/2 Broke Girls/Two.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv', None, None, '', False, 3, 248741, 1] Sep-26 13:15:10 DEBUG CP Server Thread-4 :: pattern: %S.N.%Sx%0E.%E.N

orangepeelbeef commented 10 years ago

same thing happens with archer, it looks like everything works but i get the TypeError: %d format: a number is required, not NoneType error, and the files are never moved.

Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Processing folder /opt/downloads/incoming/Archer.2009.S03E02.720p.BluRay.X264-REWARD Sep-26 13:22:18 DEBUG CP Server Thread-6 :: sickbeard.db: SELECT * FROM tv_shows Sep-26 13:22:18 INFO CP Server Thread-6 :: Processing /opt/downloads/incoming/Archer.2009.S03E02.720p.BluRay.X264-REWARD/Archer.2009.S03E02.720p.BluRay.X264-REWARD.mkv (None) Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Attempting to pp by analysing the: file name Sep-26 13:22:18 INFO CP Server Thread-6 :: Analyzing name u'Archer.2009.S03E02.720p.BluRay.X264-REWARD.mkv' Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Parser for 'Archer.2009.S03E02.720p.BluRay.X264-REWARD.mkv' locked. Starting to parse now Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Using ANIME regexs Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Using cached parse result for: Archer.2009.S03E02.720p.BluRay.X264-REWARD.mkv Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Trying to get the tvdbid for Archer 2009 Sep-26 13:22:18 DEBUG CP Server Thread-6 :: cache.db: SELECT * FROM scene_names WHERE name = ? with args [u'archer'] Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Found archer in the exception list Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Using NORMAL regexs Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Using cached parse result for: Archer.2009.S03E02.720p.BluRay.X264-REWARD.mkv Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Trying to get the tvdbid for Archer 2009 Sep-26 13:22:18 DEBUG CP Server Thread-6 :: cache.db: SELECT * FROM scene_names WHERE name = ? with args [u'archer'] Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Found archer in the exception list Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Parsed :Archer.2009.S03E02.720p.BluRay.X264-REWARD.mkv into: Archer 2009 - S3E2 absolute_numbers: [720] [ABD: False] [ANIME: True] [whichReg: ['anime_and_normal']] Sep-26 13:22:18 DEBUG CP Server Thread-6 :: This looks like a scene release converting numbers Sep-26 13:22:18 DEBUG CP Server Thread-6 :: cache.db: SELECT tvdb_id, season FROM scene_exceptions WHERE LOWER(show_name) = ? ORDER BY season ASC with args [u'archer 2009'] Sep-26 13:22:18 DEBUG CP Server Thread-6 :: cache.db: SELECT show_name, tvdb_id, season FROM scene_exceptions Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Scene exception lookup got tvdb id 110381, using that Sep-26 13:22:18 DEBUG CP Server Thread-6 :: possible seasons for 'Archer 2009' (110381) are [] Sep-26 13:22:18 DEBUG CP Server Thread-6 :: 'Archer (2009)' is a normal show i will scene convert the season and episodes 3x[2] Sep-26 13:22:18 DEBUG CP Server Thread-6 :: sickbeard.db: SELECT season, episode, name FROM tv_episodes WHERE showid = ? and scene_episode = ? and scene_season = ? with args [110381, 2, 3] Sep-26 13:22:18 DEBUG CP Server Thread-6 :: No episode found for these scene numbers. assuming these are valid tvdb numbers Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Loading show object for tvdb_id 110381 Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Retrieving episode object for 3x2 Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Looking up quality for name Archer.2009.S03E02.720p.BluRay.X264-REWARD, got 720p BluRay Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Archer.2009.S03E02.720p.BluRay.X264-REWARD looks like it has quality 720p BluRay, using that Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Quality of the episode we're processing: 128 Sep-26 13:22:18 DEBUG CP Server Thread-6 :: Is ep a priority download: False Sep-26 13:22:18 DEBUG CP Server Thread-6 :: There is no existing file so there's no worries about replacing it Sep-26 13:22:18 DEBUG CP Server Thread-6 :: good results: {1: False, 2: False, 3: False} Sep-26 13:22:18 DEBUG CP Server Thread-6 :: 110381: Saving episode details to database Sep-26 13:22:18 DEBUG CP Server Thread-6 :: STATUS IS Downloaded (720p BluRay) Sep-26 13:22:18 DEBUG CP Server Thread-6 :: sickbeard.db: UPDATE tv_episodes SET status = ?, description = ?, airdate = ?, hastbn = ?, scene_episode = ?, file_size = ?, name = ?, tvdbid = ?, scene_season = ?, location = ?, absolute_number = ?, scene_absolute_number = ?, release_name = ?, hasnfo = ? WHERE season = ? AND showid = ? AND episode = ? with args [12804, u'Cyril is promoted to field agent, while Malory institutes a strict drug-testing policy. Neither of which sit well with the staff of ISIS.', 734528, False, None, 0, u'El Contador', 4245836, None, '', None, None, '', False, 3, 110381, 2] Sep-26 13:22:18 DEBUG CP Server Thread-6 :: pattern: %S.N.%Sx%0E.%E.N

Anthirian commented 10 years ago

I was afraid this bug was introduced by me fixing the 1080p WEB-DL processing, so I thought I'd try to reproduce your issue. I was unable to, unfortunately. Luckily it seems I did not break existing functionality, as the parsing all goes smoothly.

On which branch are you? If you're on master, try switching to anime_development and see if the issue is still there.

My successful post-processing log is below:

Processing folder E:\Downloads\Unsorted\TV\2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION
Processing E:\Downloads\Unsorted\TV\2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION\2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv (None)
Parser for '2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv' locked. Starting to parse now
Trying to get the tvdbid for 2 Broke Girls
Found broke girls in the exception list
Trying to get the tvdbid for 2 Broke Girls
Found broke girls in the exception list
Parsed :2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv into: 2 Broke Girls - S3E1 absolute_numbers: [720] [ABD: False] [ANIME: True] [whichReg: ['anime_and_normal']]
This looks like a scene release converting numbers
possible seasons for '2 Broke Girls' (248741) are []
'2 Broke Girls' is a normal show i will scene convert the season and episodes 3x[1]
No episode found for these scene numbers. assuming these are valid tvdb numbers
Loading show object for tvdb_id 248741
Retrieving episode object for 3x1
Looking up quality for name 2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION, got HD TV
Is ep a priority download: False
There is no existing file so there's no worries about replacing it
Destination folder for this episode: E:\Downloads\TV\2 Broke Girls\Season 3
Moving file from E:\Downloads\Unsorted\TV\2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION\2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv to E:\Downloads\TV\2 Broke Girls\Season 3\2 Broke Girls - 03x01 - And the Soft Opening.mkv
Deleting folder E:\Downloads\Unsorted\TV\2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION
Processing succeeded for E:\Downloads\Unsorted\TV\2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION\2.Broke.Girls.S03E01.720p.HDTV.X264-DIMENSION.mkv
orangepeelbeef commented 10 years ago

I'm running anime_development, and i'm up to date. the issue is still there

same thing happens with archer, it looks like everything works but i get the TypeError: %d format: a number is required, not NoneType error, and the files are never moved.

orangepeelbeef commented 10 years ago

from sabnzbd on postprocess fail

Loading config from /opt/sabnzbd/scripts/autoProcessTV.cfg <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

``` 500 Internal Server Error ``` ```

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last):
```

  File "/usr/local/sickbeard/cherrypy/_cprequest.py", line 660, in respond

```
response.body = self.handler()
```

  File "/usr/local/sickbeard/cherrypy/lib/encoding.py", line 193, in **call**

```
self.body = self.oldhandler(*args, **kwargs)
```

  File "/usr/local/sickbeard/cherrypy/_cpdispatch.py", line 25, in __call__

```
return self.callable(*self.args, **self.kwargs)
```

  File "/usr/local/sickbeard/sickbeard/webserve.py", line 1609, in processEpisode

```
result = processTV.processDir(dir, nzbName)
```

  File "/usr/local/sickbeard/sickbeard/processTV.py", line 108, in processDir

```
process_result = processor.process()
```

  File "/usr/local/sickbeard/sickbeard/postProcessor.py", line 777, in process

```
proper_path = ep_obj.proper_path()
```

  File "/usr/local/sickbeard/sickbeard/tv.py", line 1859, in proper_path

```
result = self.formatted_filename()
```

  File "/usr/local/sickbeard/sickbeard/tv.py", line 1908, in formatted_filename

```
return self._format_pattern(name_groups[-1], multi)
```

  File "/usr/local/sickbeard/sickbeard/tv.py", line 1735, in _format_pattern

```
replace_map = self._replace_map()
```

  File "/usr/local/sickbeard/sickbeard/tv.py", line 1692, in _replace_map

```
'%A': '%03d' % self.absolute_number,
```

TypeError: %d format: a number is required, not NoneType

```
Powered by CherryPy 3.2.0rc1
```

sickbeard logs from same time... Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Processing folder /opt/downloads/incoming/Glee.S05E01.720p.HDTV.X264-DIMENSION.1 Oct-04 13:44:55 DEBUG CP Server Thread-4 :: sickbeard.db: SELECT * FROM tv_shows Oct-04 13:44:55 INFO CP Server Thread-4 :: Processing /opt/downloads/incoming/Glee.S05E01.720p.HDTV.X264-DIMENSION.1/Glee.S05E01.720p.HDTV.X264-DIMENSION.mkv (Glee.S05E01.720p.HDTV.X264-DIMENSION.nzb) Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Attempting to pp by analysing the: file name Oct-04 13:44:55 INFO CP Server Thread-4 :: Analyzing name u'Glee.S05E01.720p.HDTV.X264-DIMENSION.mkv' Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Parser for 'Glee.S05E01.720p.HDTV.X264-DIMENSION.mkv' locked. Starting to parse now Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Using ANIME regexs Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Trying to get the tvdbid for Glee Oct-04 13:44:55 DEBUG CP Server Thread-4 :: cache.db: SELECT * FROM scene_names WHERE name = ? with args [u'glee'] Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Found glee in the exception list Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Using NORMAL regexs Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Using cached parse result for: Glee.S05E01.720p.HDTV.X264-DIMENSION.mkv Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Trying to get the tvdbid for Glee Oct-04 13:44:55 DEBUG CP Server Thread-4 :: cache.db: SELECT * FROM scene_names WHERE name = ? with args [u'glee'] Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Found glee in the exception list Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Parsed :Glee.S05E01.720p.HDTV.X264-DIMENSION.mkv into: Glee - S5E1 absolute_numbers: [720] [ABD: False] [ANIME: True] [whichReg: ['anime_and_normal']] Oct-04 13:44:55 DEBUG CP Server Thread-4 :: This looks like a scene release converting numbers Oct-04 13:44:55 DEBUG CP Server Thread-4 :: cache.db: SELECT tvdb_id, season FROM scene_exceptions WHERE LOWER(show_name) = ? ORDER BY season ASC with args [u'glee'] Oct-04 13:44:55 DEBUG CP Server Thread-4 :: cache.db: SELECT show_name, tvdb_id, season FROM scene_exceptions Oct-04 13:44:55 DEBUG CP Server Thread-4 :: possible seasons for 'Glee' (83610) are [] Oct-04 13:44:55 DEBUG CP Server Thread-4 :: 'Glee' is a normal show i will scene convert the season and episodes 5x[1] Oct-04 13:44:55 DEBUG CP Server Thread-4 :: sickbeard.db: SELECT season, episode, name FROM tv_episodes WHERE showid = ? and scene_episode = ? and scene_season = ? with args [83610, 1, 5] Oct-04 13:44:55 DEBUG CP Server Thread-4 :: No episode found for these scene numbers. assuming these are valid tvdb numbers Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Loading show object for tvdb_id 83610 Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Retrieving episode object for 5x1 Oct-04 13:44:55 DEBUG CP Server Thread-4 :: The old status had a quality in it, using that: HD TV Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Quality of the episode we're processing: 4 Oct-04 13:44:55 DEBUG CP Server Thread-4 :: SB snatched this episode so I'm marking it as priority Oct-04 13:44:55 DEBUG CP Server Thread-4 :: Is ep a priority download: True Oct-04 13:44:56 DEBUG CP Server Thread-4 :: There is no existing file so there's no worries about replacing it Oct-04 13:44:56 DEBUG CP Server Thread-4 :: This download is marked a priority download so I'm going to replace an existing file if I find one Oct-04 13:44:56 DEBUG CP Server Thread-4 :: good results: {1: False, 2: False, 3: False} Oct-04 13:44:56 DEBUG CP Server Thread-4 :: 83610: Saving episode details to database Oct-04 13:44:56 DEBUG CP Server Thread-4 :: STATUS IS Downloaded (HD TV) Oct-04 13:44:56 DEBUG CP Server Thread-4 :: sickbeard.db: UPDATE tv_episodes SET status = ?, description = ?, airdate = ?, hastbn = ?, scene_episode = ?, file_size = ?, name = ?, tvdbid = ?, scene_season = ?, location = ?, absolute_number = ?, scene_absolute_number = ?, release_name = ?, hasnfo = ? WHERE season = ? AND showid = ? AND episode = ? with args [404, u"The members of New Directions are back in action and take on their biggest assignment yet: the Beatles! As Will enlists the kids to pay homage to the classic song catalog from the Fab Four, Blaine and Kurt attempt to answer questions about their future together. Meanwhile, Rachel's New York ambitions take an unexpected turn.", 735137, False, None, 0, u'Love, Love, Love', 4600824, None, '', None, None, '', False, 5, 83610, 1] Oct-04 13:44:56 DEBUG CP Server Thread-4 :: pattern: %S.N.%Sx%0E.%E.N