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
439cda8b
Commit
439cda8b
authored
Dec 22, 2012
by
Ruud
Browse files
Options
Downloads
Patches
Plain Diff
Newznab age wrong. fix #1171
parent
bbe8362b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
couchpotato/core/providers/nzb/newznab/main.py
+21
-7
21 additions, 7 deletions
couchpotato/core/providers/nzb/newznab/main.py
with
21 additions
and
7 deletions
couchpotato/core/providers/nzb/newznab/main.py
+
21
−
7
View file @
439cda8b
...
@@ -53,7 +53,7 @@ class Newznab(NZBProvider, RSS):
...
@@ -53,7 +53,7 @@ class Newznab(NZBProvider, RSS):
'
r
'
:
host
[
'
api_key
'
],
'
r
'
:
host
[
'
api_key
'
],
'
i
'
:
58
,
'
i
'
:
58
,
})
})
url
=
"
%s?%s
"
%
(
cleanHost
(
host
[
'
host
'
])
+
'
rss
'
,
arguments
)
url
=
'
%s?%s
'
%
(
cleanHost
(
host
[
'
host
'
])
+
'
rss
'
,
arguments
)
cache_key
=
'
newznab.%s.feed.%s
'
%
(
host
[
'
host
'
],
arguments
)
cache_key
=
'
newznab.%s.feed.%s
'
%
(
host
[
'
host
'
],
arguments
)
results
=
self
.
createItems
(
url
,
cache_key
,
host
,
for_feed
=
True
)
results
=
self
.
createItems
(
url
,
cache_key
,
host
,
for_feed
=
True
)
...
@@ -87,7 +87,7 @@ class Newznab(NZBProvider, RSS):
...
@@ -87,7 +87,7 @@ class Newznab(NZBProvider, RSS):
'
apikey
'
:
host
[
'
api_key
'
],
'
apikey
'
:
host
[
'
api_key
'
],
'
extended
'
:
1
'
extended
'
:
1
})
})
url
=
"
%s&%s
"
%
(
self
.
getUrl
(
host
[
'
host
'
],
self
.
urls
[
'
search
'
]),
arguments
)
url
=
'
%s&%s
'
%
(
self
.
getUrl
(
host
[
'
host
'
],
self
.
urls
[
'
search
'
]),
arguments
)
cache_key
=
'
newznab.%s.%s.%s
'
%
(
host
[
'
host
'
],
movie
[
'
library
'
][
'
identifier
'
],
cat_id
)
cache_key
=
'
newznab.%s.%s.%s
'
%
(
host
[
'
host
'
],
movie
[
'
library
'
][
'
identifier
'
],
cat_id
)
...
@@ -111,19 +111,33 @@ class Newznab(NZBProvider, RSS):
...
@@ -111,19 +111,33 @@ class Newznab(NZBProvider, RSS):
results
=
[]
results
=
[]
for
nzb
in
nzbs
:
for
nzb
in
nzbs
:
nzb_id
=
self
.
getTextElement
(
nzb
,
"
guid
"
).
split
(
'
/
'
)[
-
1
:].
pop
()
date
=
None
for
item
in
nzb
:
if
item
.
attrib
.
get
(
'
name
'
)
==
'
usenetdate
'
:
date
=
item
.
attrib
.
get
(
'
value
'
)
break
if
not
date
:
date
=
self
.
getTextElement
(
nzb
,
'
pubDate
'
)
nzb_id
=
self
.
getTextElement
(
nzb
,
'
guid
'
).
split
(
'
/
'
)[
-
1
:].
pop
()
name
=
self
.
getTextElement
(
nzb
,
'
title
'
)
if
not
name
:
continue
new
=
{
new
=
{
'
id
'
:
nzb_id
,
'
id
'
:
nzb_id
,
'
provider
'
:
self
.
getName
(),
'
provider
'
:
self
.
getName
(),
'
provider_extra
'
:
host
[
'
host
'
],
'
provider_extra
'
:
host
[
'
host
'
],
'
type
'
:
'
nzb
'
,
'
type
'
:
'
nzb
'
,
'
name
'
:
self
.
getTextElement
(
nzb
,
"
title
"
),
'
name
'
:
self
.
getTextElement
(
nzb
,
'
title
'
),
'
age
'
:
self
.
calculateAge
(
int
(
time
.
mktime
(
parse
(
self
.
getTextElement
(
nzb
,
'
pubD
ate
'
)
).
timetuple
()))),
'
age
'
:
self
.
calculateAge
(
int
(
time
.
mktime
(
parse
(
d
ate
).
timetuple
()))),
'
size
'
:
int
(
self
.
getElement
(
nzb
,
"
enclosure
"
).
attrib
[
'
length
'
])
/
1024
/
1024
,
'
size
'
:
int
(
self
.
getElement
(
nzb
,
'
enclosure
'
).
attrib
[
'
length
'
])
/
1024
/
1024
,
'
url
'
:
(
self
.
getUrl
(
host
[
'
host
'
],
self
.
urls
[
'
download
'
])
%
nzb_id
)
+
self
.
getApiExt
(
host
),
'
url
'
:
(
self
.
getUrl
(
host
[
'
host
'
],
self
.
urls
[
'
download
'
])
%
nzb_id
)
+
self
.
getApiExt
(
host
),
'
download
'
:
self
.
download
,
'
download
'
:
self
.
download
,
'
detail_url
'
:
'
%sdetails/%s
'
%
(
cleanHost
(
host
[
'
host
'
]),
nzb_id
),
'
detail_url
'
:
'
%sdetails/%s
'
%
(
cleanHost
(
host
[
'
host
'
]),
nzb_id
),
'
content
'
:
self
.
getTextElement
(
nzb
,
"
description
"
),
'
content
'
:
self
.
getTextElement
(
nzb
,
'
description
'
),
}
}
if
not
for_feed
:
if
not
for_feed
:
...
...
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