evilhero / mylar

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

Tor2Client Issue: RSSCheck.py - Local Variable 'r' Referenced Before Assignment #1520

Closed JasonMSims closed 7 years ago

JasonMSims commented 7 years ago

It appears that the RSSCheck script errors out at line 949, due to a variable that has not yet been assigned. Before that though, it appears that an error is encountered trying to retrieve the file from DEM - which is an SSL issue, I presume? Python version is 2.7.12, running on Ubuntu 16.04. I just deleted the config.ini and reconfigured from scratch to make sure I hadn't screwed something up or that there weren't any obsolete flags floating around in it. Same result.

2017-01-02 12:12:43 ERROR   Uncaught exception: Traceback (most recent call last):
File "/opt/mylar/mylar/logger.py", line 158, in new_run
old_run(*args, **kwargs)
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/opt/mylar/mylar/webserve.py", line 1415, in queueissue
foundcom, prov = search.search_init(ComicName, ComicIssue, ComicYear, SeriesYear, Publisher, issues['IssueDate'], storedate, IssueID, AlternateSearch, UseAFuzzy, ComicVersion, mode=mode, ComicID=ComicID, manualsearch=manualsearch, filesafe=ComicName_Filesafe, allow_packs=AllowPacks)
File "/opt/mylar/mylar/search.py", line 238, in search_init
findit = NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDate, StoreDate, searchprov, send_prov_count, IssDateFix, IssueID, UseFuzzy, newznab_host, ComicVersion=ComicVersion, SARC=SARC, IssueArcID=IssueArcID, RSS="yes", ComicID=ComicID, issuetitle=issuetitle, unaltered_ComicName=unaltered_ComicName)
File "/opt/mylar/mylar/search.py", line 1556, in NZB_SEARCH
searchresult = searcher(nzbprov, nzbname, comicinfo, entry['link'], IssueID, ComicID, tmpprov, newznab=newznab_host)
File "/opt/mylar/mylar/search.py", line 2166, in searcher
rcheck = rsscheck.torsend2client(ComicName, IssueNumber, comyear, link, nzbprov)
File "/opt/mylar/mylar/rsscheck.py", line 949, in torsend2client
logger.info('blah: ' + str(r.status_code))
UnboundLocalError: local variable 'r' referenced before assignment
2017-01-02 12:12:43 WARNING Error fetching data from DEM (https://www.demonoid.cc/files/download/3414196/): EOF occurred in violation of protocol (_ssl.c:590)
2017-01-02 12:12:42 INFO    matched on Detective Comics
2017-01-02 12:12:42 INFO    [FAILED_DOWNLOAD_CHECKER] Successfully marked this download as Good for downloadable content
2017-01-02 12:12:42 INFO    prov : DEM [RSS][3414196]
2017-01-02 12:12:42 INFO    Found Detective Comics (2016) issue: 938 using DEM [RSS]
2017-01-02 12:12:42 INFO    allow_packs:None
2017-01-02 12:12:42 INFO    rss:yes
2017-01-02 12:12:42 INFO    DEM
2017-01-02 12:12:42 INFO    Shhh be very quiet...I'm looking for Detective Comics issue: 938 (2016) using TPSE [RSS]
2017-01-02 12:12:42 INFO    allow_packs set to :None
2017-01-02 12:12:42 INFO    search provider order is ['tpse', 'dognzb', 'Experimental']
2017-01-02 12:12:42 INFO    Issue Title given as : rise of the batmen part five: enemy at the gates
2017-01-02 12:12:42 INFO    Initiating manual search for Detective Comics issue: 938
evilhero commented 7 years ago

That's probably a localized ssl issue, like you've already figured out.

Doing a 'pip install requests[security]' or 'pip install[cryptography]' might fix things as it has to do with not being able to verify sni and the requests module actually has an outstanding error about this exact message. Just unsure whether the security or cryptography will fix things, as it's still an open requests issue.

EDIT. Well ok, the error itself is an outstanding requests issue. It does look like that demonoid changed their url for their feeds to a different domain entirely. Let me see if I can change it and hopefully it will fix the ssl errors (since it's grabbing the rss correctly since it's able to retrieve and search the resulting list, it just can't download since it's pointing to the wrong domain now)

JasonMSims commented 7 years ago

Commit 2188061 fixed this issue.