Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CouchPotatoServer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
CouchPotatoServer
Commits
907f821e
Commit
907f821e
authored
Oct 14, 2012
by
Ruud
Browse files
Options
Downloads
Patches
Plain Diff
Some more logging for SABNZBd
parent
9dc1843f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
couchpotato/core/downloaders/sabnzbd/main.py
+10
-8
10 additions, 8 deletions
couchpotato/core/downloaders/sabnzbd/main.py
with
10 additions
and
8 deletions
couchpotato/core/downloaders/sabnzbd/main.py
+
10
−
8
View file @
907f821e
...
@@ -2,6 +2,7 @@ from couchpotato.core.downloaders.base import Downloader
...
@@ -2,6 +2,7 @@ from couchpotato.core.downloaders.base import Downloader
from
couchpotato.core.helpers.encoding
import
tryUrlencode
from
couchpotato.core.helpers.encoding
import
tryUrlencode
from
couchpotato.core.helpers.variable
import
cleanHost
,
mergeDicts
from
couchpotato.core.helpers.variable
import
cleanHost
,
mergeDicts
from
couchpotato.core.logger
import
CPLog
from
couchpotato.core.logger
import
CPLog
from
urllib2
import
URLError
import
json
import
json
import
traceback
import
traceback
...
@@ -43,8 +44,11 @@ class Sabnzbd(Downloader):
...
@@ -43,8 +44,11 @@ class Sabnzbd(Downloader):
sab
=
self
.
urlopen
(
url
,
timeout
=
60
,
params
=
{
"
nzbfile
"
:
(
nzb_filename
,
filedata
)},
multipart
=
True
,
show_error
=
False
)
sab
=
self
.
urlopen
(
url
,
timeout
=
60
,
params
=
{
"
nzbfile
"
:
(
nzb_filename
,
filedata
)},
multipart
=
True
,
show_error
=
False
)
else
:
else
:
sab
=
self
.
urlopen
(
url
,
timeout
=
60
,
show_error
=
False
)
sab
=
self
.
urlopen
(
url
,
timeout
=
60
,
show_error
=
False
)
except
URLError
:
log
.
error
(
'
Failed sending release, probably wrong HOST: %s
'
,
traceback
.
format_exc
(
0
))
return
False
except
:
except
:
log
.
error
(
'
Failed sending release: %s
'
,
traceback
.
format_exc
())
log
.
error
(
'
Failed sending release
, use API key, NOT the NZB key
: %s
'
,
traceback
.
format_exc
(
0
))
return
False
return
False
result
=
sab
.
strip
()
result
=
sab
.
strip
()
...
@@ -53,14 +57,12 @@ class Sabnzbd(Downloader):
...
@@ -53,14 +57,12 @@ class Sabnzbd(Downloader):
return
False
return
False
log
.
debug
(
"
Result text from SAB:
"
+
result
[:
40
])
log
.
debug
(
"
Result text from SAB:
"
+
result
[:
40
])
print
result
if
result
==
"
ok
"
:
if
result
==
"
ok
"
:
log
.
info
(
"
NZB sent to SAB successfully.
"
)
log
.
info
(
"
NZB sent to SAB successfully.
"
)
return
True
return
True
elif
result
==
"
Missing authentication
"
:
log
.
error
(
"
Incorrect username/password.
"
)
return
False
else
:
else
:
log
.
error
(
"
Unknown error:
"
+
result
[:
40
])
log
.
error
(
result
[:
40
])
return
False
return
False
def
getAllDownloadStatus
(
self
):
def
getAllDownloadStatus
(
self
):
...
@@ -75,7 +77,7 @@ class Sabnzbd(Downloader):
...
@@ -75,7 +77,7 @@ class Sabnzbd(Downloader):
'
mode
'
:
'
queue
'
,
'
mode
'
:
'
queue
'
,
})
})
except
:
except
:
log
.
error
(
'
Failed getting queue: %s
'
,
traceback
.
format_exc
())
log
.
error
(
'
Failed getting queue: %s
'
,
traceback
.
format_exc
(
0
))
return
False
return
False
# Go through history items
# Go through history items
...
@@ -85,7 +87,7 @@ class Sabnzbd(Downloader):
...
@@ -85,7 +87,7 @@ class Sabnzbd(Downloader):
'
limit
'
:
15
,
'
limit
'
:
15
,
})
})
except
:
except
:
log
.
error
(
'
Failed getting history json: %s
'
,
traceback
.
format_exc
())
log
.
error
(
'
Failed getting history json: %s
'
,
traceback
.
format_exc
(
0
))
return
False
return
False
statuses
=
[]
statuses
=
[]
...
@@ -134,7 +136,7 @@ class Sabnzbd(Downloader):
...
@@ -134,7 +136,7 @@ class Sabnzbd(Downloader):
'
value
'
:
item
[
'
id
'
]
'
value
'
:
item
[
'
id
'
]
},
use_json
=
False
)
},
use_json
=
False
)
except
:
except
:
log
.
error
(
'
Failed deleting: %s
'
,
traceback
.
format_exc
())
log
.
error
(
'
Failed deleting: %s
'
,
traceback
.
format_exc
(
0
))
return
False
return
False
return
True
return
True
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment