evilhero / mylar

An automated Comic Book downloader (cbr/cbz) for use with SABnzbd, NZBGet and torrents
GNU General Public License v3.0
977 stars 172 forks source link

Traceback: string index out of range. #711

Closed bmfrosty closed 7 years ago

bmfrosty commented 10 years ago

This is on the new dev build:

25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] watchcomic:Batman Beyond 2.0 ..comparing to found file: Ultimatum 05 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] std is : 2.0 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] numberinseries: False 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] decimalinseries: True 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] subnm len : 1 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] 1: detected invalid filename - attempting to detect year to continue 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] watch-cleaned: Batman Beyond 20 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] sub-cleaned: Red-Hood-and-the-Outlaws-013--2012---digital-Empire- 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] new subname: -Outlaws-013--2012---digital-Empire- 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] subname no brackets: Batman Beyond 2.0-Outlaws-013--2012---digital-Empire- 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] decimal issue detected. 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] possible negative issue detected. 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] possible negative issue detected. 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] watchcomic:Batman Beyond 2.0 ..comparing to found file: Batman Beyond 2.0-Outlaws-013--2012---digital-Empire- 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] Batman Beyond 2.0 - watchlist match on : /mnt/user/Primary/comics-import/Red-Hood-and-the-Outlaws-013--2012---digital-Empire-.cbr 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] we should remove 18 characters 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] detected 9 special characters 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] special character appears outside of title - ignoring @ position: 25 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] special character appears outside of title - ignoring @ position: 29 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] special character appears outside of title - ignoring @ position: 30 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] special character appears outside of title - ignoring @ position: 35 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] special character appears outside of title - ignoring @ position: 36 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] special character appears outside of title - ignoring @ position: 37 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : [FILECHECKER] special character appears outside of title - ignoring @ position: 45 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : Exception generated in thread FOLDERMONITOR: string index out of range 25-May-2014 22:36:42 - DEBUG :: FOLDERMONITOR : 'Traceback (most recent call last):\n File "/home/bmfrosty/mylar/mylar/scheduler.py", line 78, in runAction\n self.action.run()\n File "/home/bmfrosty/mylar/mylar/PostProcessor.py", line 898, in run\n result = PostProcess.Process()\n File "/home/bmfrosty/mylar/mylar/PostProcessor.py", line 209, in Process\n watchmatch = filechecker.listFiles(self.nzb_folder,cs[\'ComicName\'],cs[\'ComicPublisher\'],cs[\'AlternateSearch\'], manual=watchvals)\n File "/home/bmfrosty/mylar/mylar/filechecker.py", line 392, in listFiles\n if j <= len(subname) and subname[j+1].isdigit():\nIndexError: string index out of range\n' bmfrosty@yaar:~/mylar$

bmfrosty commented 10 years ago

A different one.

25-May-2014 22:47:47 - INFO :: SEARCH : Could not find Issue 3 of The Flash(2011) using KAT 25-May-2014 22:47:47 - INFO :: SEARCH : Shhh be very quiet...I'm looking for The Flash issue: 3 (2012) using experimental [RSS] 25-May-2014 22:47:47 - DEBUG :: SEARCH : calpha/cnumber: None / None 25-May-2014 22:47:47 - DEBUG :: SEARCH : RSS Check: yes 25-May-2014 22:47:47 - DEBUG :: SEARCH : nzbprov: experimental 25-May-2014 22:47:47 - DEBUG :: SEARCH : comicid: 43018 25-May-2014 22:47:47 - DEBUG :: SEARCH : Sending request to RSS for The Flash : 003 (2012) 25-May-2014 22:47:47 - DEBUG :: SEARCH : bb results: {'entries': []} 25-May-2014 22:47:47 - DEBUG :: SEARCH : RSS Check: yes 25-May-2014 22:47:47 - DEBUG :: SEARCH : nzbprov: experimental 25-May-2014 22:47:47 - DEBUG :: SEARCH : comicid: 43018 25-May-2014 22:47:47 - DEBUG :: SEARCH : Sending request to RSS for The Flash : 03 (2012) 25-May-2014 22:47:47 - DEBUG :: SEARCH : bb results: {'entries': []} 25-May-2014 22:47:47 - DEBUG :: SEARCH : RSS Check: yes 25-May-2014 22:47:47 - DEBUG :: SEARCH : nzbprov: experimental 25-May-2014 22:47:47 - DEBUG :: SEARCH : comicid: 43018 25-May-2014 22:47:47 - DEBUG :: SEARCH : Sending request to RSS for The Flash : 3 (2012) 25-May-2014 22:47:47 - DEBUG :: SEARCH : bb results: {'entries': []} 25-May-2014 22:47:47 - INFO :: SEARCH : Could not find Issue 3 of The Flash(2011) using experimental 25-May-2014 22:47:47 - DEBUG :: SEARCH : Finished searching via : rss 25-May-2014 22:47:47 - INFO :: SEARCH : Issue not found. Status kept as Wanted. 25-May-2014 22:47:47 - DEBUG :: SEARCH : Initiating Search via : api 25-May-2014 22:47:47 - INFO :: SEARCH : Shhh be very quiet...I'm looking for The Flash issue: 3 (2012) using KAT 25-May-2014 22:47:47 - DEBUG :: SEARCH : calpha/cnumber: None / None 25-May-2014 22:47:47 - DEBUG :: SEARCH : RSS Check: None 25-May-2014 22:47:47 - DEBUG :: SEARCH : nzbprov: KAT 25-May-2014 22:47:47 - DEBUG :: SEARCH : comicid: 43018 25-May-2014 22:47:47 - DEBUG :: SEARCH : Sending request to [KAT] for flash : 003 25-May-2014 22:47:48 - DEBUG :: SEARCH : [KAT] there were 2 results.. 25-May-2014 22:47:48 - DEBUG :: SEARCH : [KAT] there were 2 results.. 25-May-2014 22:47:48 - DEBUG :: SEARCH : checking search result: The Flash Annual 001-003 25-May-2014 22:47:48 - DEBUG :: SEARCH : size given as: 148.2 MB 25-May-2014 22:47:48 - DEBUG :: SEARCH : Sat, 03 May 2014 17:40:40 +0000 is after store date of 2011-11-23 25-May-2014 22:47:48 - DEBUG :: SEARCH : Entry: The Flash Annual 001-003 25-May-2014 22:47:48 - DEBUG :: SEARCH : Cleantitle: the flash annual 001-003 25-May-2014 22:47:48 - DEBUG :: SEARCH : detected invalid nzb filename - attempting to detect year to continue 25-May-2014 22:47:48 - DEBUG :: SEARCH : Cleantitle: the flash annual 001-003 25-May-2014 22:47:48 - DEBUG :: SEARCH : 0. Bracket Word: the flash annual 001-003 25-May-2014 22:47:48 - DEBUG :: SEARCH : Comic: the flash annual 001-003 25-May-2014 22:47:48 - DEBUG :: SEARCH : UseFuzzy is : None 25-May-2014 22:47:48 - DEBUG :: SEARCH : ComVersChk : 4 25-May-2014 22:47:48 - DEBUG :: SEARCH : checking search result: The Flash Annual 003 (2014) (digital-Empire).cbr 25-May-2014 22:47:48 - DEBUG :: SEARCH : size given as: 68.2 MB 25-May-2014 22:47:48 - DEBUG :: SEARCH : Wed, 30 Apr 2014 14:00:03 +0000 is after store date of 2011-11-23 25-May-2014 22:47:48 - DEBUG :: SEARCH : Entry: The Flash Annual 003 (2014) (digital-Empire).cbr 25-May-2014 22:47:48 - DEBUG :: SEARCH : Removed extension from filename: .cbr 25-May-2014 22:47:48 - DEBUG :: SEARCH : Cleantitle: the flash annual 003 (2014) (digital-empire) 25-May-2014 22:47:48 - DEBUG :: SEARCH : Cleantitle: the flash annual 003 (2014) (digital-empire) 25-May-2014 22:47:48 - DEBUG :: SEARCH : 0. Bracket Word: the flash annual 003 25-May-2014 22:47:48 - DEBUG :: SEARCH : Comic: the flash annual 003 25-May-2014 22:47:48 - DEBUG :: SEARCH : UseFuzzy is : None 25-May-2014 22:47:48 - DEBUG :: SEARCH : ComVersChk : 4 25-May-2014 22:47:48 - DEBUG :: SEARCH : 1. Bracket Word: 2014 25-May-2014 22:47:48 - DEBUG :: SEARCH : year detected: 2014 25-May-2014 22:47:48 - DEBUG :: SEARCH : year looking for: 2012 25-May-2014 22:47:48 - DEBUG :: SEARCH : 2012 - not right - years do not match 25-May-2014 22:47:48 - DEBUG :: SEARCH : 2012 - not the right year. 25-May-2014 22:47:48 - DEBUG :: SEARCH : 3. Bracket Word: digital-empire 25-May-2014 22:47:48 - DEBUG :: SEARCH : Scanner detected: digital-empire 25-May-2014 22:47:48 - DEBUG :: SEARCH : Scanner detected: digital-empire 25-May-2014 22:47:48 - DEBUG :: SEARCH : RSS Check: None 25-May-2014 22:47:48 - DEBUG :: SEARCH : nzbprov: KAT 25-May-2014 22:47:48 - DEBUG :: SEARCH : comicid: 43018 25-May-2014 22:47:48 - DEBUG :: SEARCH : Sending request to [KAT] for flash : 03 25-May-2014 22:47:49 - DEBUG :: SEARCH : [KAT] there were 16 results.. 25-May-2014 22:47:50 - DEBUG :: SEARCH : Exception generated in thread SEARCH: list index out of range 25-May-2014 22:47:50 - DEBUG :: SEARCH : 'Traceback (most recent call last):\n File "/home/bmfrosty/mylar/mylar/scheduler.py", line 78, in runAction\n self.action.run()\n File "/home/bmfrosty/mylar/mylar/searchit.py", line 30, in run\n mylar.search.searchforissue()\n File "/home/bmfrosty/mylar/mylar/search.py", line 1396, in searchforissue\n foundNZB, prov = search_init(comic[\'ComicName\'], result[\'Issue_Number\'], str(ComicYear), comic[\'ComicYear\'], Publisher, IssueDate, StoreDate, result[\'IssueID\'], AlternateSearch, UseFuzzy, ComicVersion, SARC=None, IssueArcID=None, mode=mode, rsscheck=rsscheck, ComicID=result[\'ComicID\'])\n File "/home/bmfrosty/mylar/mylar/search.py", line 213, in search_init\n findit = NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDate, StoreDate, searchprov, prov_count, IssDateFix, IssueID, UseFuzzy, newznab_host, ComicVersion=ComicVersion, SARC=SARC, IssueArcID=IssueArcID, ComicID=ComicID)\n File "/home/bmfrosty/mylar/mylar/search.py", line 464, in NZB_SEARCH\n bb = rsscheck.torrents(pickfeed=\'KAT\',seriesname=cmname,issue=mod_isssearch)\n File "/home/bmfrosty/mylar/mylar/rsscheck.py", line 164, in torrents\n tmpsz = feedme.entries[i].enclosures[0]\nIndexError: list index out of range\n'

evilhero commented 10 years ago

Ok, so this is twofold.

The first error is because you're using a non-standard character as a space replacement. In Mylar, the hyphen denotes either a title start or a negative issue (or something), it doesn't denote a space (it can't - it would be just too confusing when parsing from what I can see at this time anyways). Change the filename to coincide with some standard 'space' (ie.,' ', '_', '.')

The second I'll look at, it looks like it's trying to go to the next rss search entry but there isn't one so it's crapping out...

bmfrosty commented 10 years ago

Ah. Yes. I should have opened two issues. Apologies.

For the first one, it would be nice if it would catch the exception and drop a regular log line requesting that the user rename the file, and then continue on to the next file.

evilhero commented 10 years ago

Its a possibility, it would have to determine that it's a fail though, and the error message it threw is only because it removed one too many characters earlier and didn't account for the change in the name (it thinks that there are 8 characters to replace, but only finds 7 and it's at the end of the filename).

Definitely something to look into further for sure since avoiding these types of errors means the program runs longer ;)