mirror of https://github.com/evilhero/mylar
fixed User-Agent problem for nzb.su, fixed startup failure if version wasn't detected
This commit is contained in:
parent
5817ff18f6
commit
e9e9d31d3a
|
@ -429,7 +429,10 @@ def initialize():
|
|||
# Get the currently installed version - returns None, 'win32' or the git hash
|
||||
# Also sets INSTALL_TYPE variable to 'win', 'git' or 'source'
|
||||
CURRENT_VERSION = versioncheck.getVersion()
|
||||
if CURRENT_VERSION is not None:
|
||||
hash = CURRENT_VERSION[:7]
|
||||
else:
|
||||
hash = "unknown"
|
||||
print ("hash is set to : " + str(hash))
|
||||
|
||||
if version.MYLAR_VERSION == 'master':
|
||||
|
|
|
@ -15,8 +15,8 @@ def searchit(cm):
|
|||
|
||||
logger.fdebug(u'Parsing results from <a href="%s">nzbx.co</a>' % searchURL)
|
||||
request = urllib2.Request(searchURL)
|
||||
request.add_header(mylar.USER_AGENT)
|
||||
opener = urllib2.build_opener()
|
||||
request.add_header('User-Agent', str(mylar.USER_AGENT))
|
||||
opener = urllib2.build_opener(urllib2.HTTPHandler(debuglevel=1))
|
||||
|
||||
try:
|
||||
data = opener.open(request).read()
|
||||
|
|
|
@ -347,8 +347,8 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
|
|||
# Add a user-agent
|
||||
print ("user-agent:" + str(mylar.USER_AGENT))
|
||||
request = urllib2.Request(findurl)
|
||||
request.add_header('User Agent', str(mylar.USER_AGENT))
|
||||
opener = urllib2.build_opener()
|
||||
request.add_header('User-Agent', str(mylar.USER_AGENT))
|
||||
opener = urllib2.build_opener(urllib2.HTTPHandler(debuglevel=1))
|
||||
|
||||
try:
|
||||
data = opener.open(request).read()
|
||||
|
|
Loading…
Reference in New Issue