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
f9bdf6da
Commit
f9bdf6da
authored
Feb 12, 2013
by
Ruud
Browse files
Options
Downloads
Patches
Plain Diff
Send correct headers to SABNZBd. fix #1406
parent
87cdf922
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
+4
-3
4 additions, 3 deletions
couchpotato/core/downloaders/sabnzbd/main.py
with
4 additions
and
3 deletions
couchpotato/core/downloaders/sabnzbd/main.py
+
4
−
3
View file @
f9bdf6da
...
@@ -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
,
ss
from
couchpotato.core.helpers.encoding
import
tryUrlencode
,
ss
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
couchpotato.environment
import
Env
from
urllib2
import
URLError
from
urllib2
import
URLError
import
json
import
json
import
traceback
import
traceback
...
@@ -38,9 +39,9 @@ class Sabnzbd(Downloader):
...
@@ -38,9 +39,9 @@ class Sabnzbd(Downloader):
try
:
try
:
if
params
.
get
(
'
mode
'
)
is
'
addfile
'
:
if
params
.
get
(
'
mode
'
)
is
'
addfile
'
:
sab
=
self
.
urlopen
(
url
,
timeout
=
60
,
params
=
{
'
nzbfile
'
:
(
ss
(
nzb_filename
),
filedata
)},
multipart
=
True
,
show_error
=
False
)
sab
=
self
.
urlopen
(
url
,
timeout
=
60
,
params
=
{
'
nzbfile
'
:
(
ss
(
nzb_filename
),
filedata
)},
multipart
=
True
,
show_error
=
False
,
headers
=
{
'
User-Agent
'
:
Env
.
getIdentifier
()}
)
else
:
else
:
sab
=
self
.
urlopen
(
url
,
timeout
=
60
,
show_error
=
False
)
sab
=
self
.
urlopen
(
url
,
timeout
=
60
,
show_error
=
False
,
headers
=
{
'
User-Agent
'
:
Env
.
getIdentifier
()}
)
except
URLError
:
except
URLError
:
log
.
error
(
'
Failed sending release, probably wrong HOST: %s
'
,
traceback
.
format_exc
(
0
))
log
.
error
(
'
Failed sending release, probably wrong HOST: %s
'
,
traceback
.
format_exc
(
0
))
return
False
return
False
...
@@ -139,7 +140,7 @@ class Sabnzbd(Downloader):
...
@@ -139,7 +140,7 @@ class Sabnzbd(Downloader):
'
output
'
:
'
json
'
'
output
'
:
'
json
'
}))
}))
data
=
self
.
urlopen
(
url
,
timeout
=
60
,
show_error
=
False
)
data
=
self
.
urlopen
(
url
,
timeout
=
60
,
show_error
=
False
,
headers
=
{
'
User-Agent
'
:
Env
.
getIdentifier
()}
)
if
use_json
:
if
use_json
:
d
=
json
.
loads
(
data
)
d
=
json
.
loads
(
data
)
if
d
.
get
(
'
error
'
):
if
d
.
get
(
'
error
'
):
...
...
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