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
580ff381
Commit
580ff381
authored
Dec 30, 2012
by
Kris Kater
Committed by
Ruud
Dec 30, 2012
Browse files
Options
Downloads
Patches
Plain Diff
Added moviemeter.nl automation
parent
6b8bca54
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
couchpotato/core/providers/automation/moviemeter_nl/__init__.py
+23
-0
23 additions, 0 deletions
...otato/core/providers/automation/moviemeter_nl/__init__.py
couchpotato/core/providers/automation/moviemeter_nl/main.py
+39
-0
39 additions, 0 deletions
couchpotato/core/providers/automation/moviemeter_nl/main.py
with
62 additions
and
0 deletions
couchpotato/core/providers/automation/moviemeter_nl/__init__.py
0 → 100644
+
23
−
0
View file @
580ff381
from
.main
import
Moviemeter
def
start
():
return
Moviemeter
()
config
=
[{
'
name
'
:
'
moviemeter
'
,
'
groups
'
:
[
{
'
tab
'
:
'
automation
'
,
'
name
'
:
'
moviemeter_automation
'
,
'
label
'
:
'
Moviemeter
'
,
'
description
'
:
'
Imports movies from the current top 10 of moviemeter.nl. (uses minimal requirements)
'
,
'
options
'
:
[
{
'
name
'
:
'
automation_enabled
'
,
'
default
'
:
False
,
'
type
'
:
'
enabler
'
,
},
],
},
],
}]
This diff is collapsed.
Click to expand it.
couchpotato/core/providers/automation/moviemeter_nl/main.py
0 → 100644
+
39
−
0
View file @
580ff381
from
couchpotato.core.helpers.rss
import
RSS
from
couchpotato.core.helpers.variable
import
md5
from
couchpotato.core.logger
import
CPLog
from
couchpotato.core.providers.automation.base
import
Automation
import
datetime
import
xml.etree.ElementTree
as
XMLTree
log
=
CPLog
(
__name__
)
class
Moviemeter
(
Automation
,
RSS
):
interval
=
1800
rss_url
=
'
http://www.moviemeter.nl/rss/cinema
'
def
getIMDBids
(
self
):
if
self
.
isDisabled
():
return
movies
=
[]
cache_key
=
'
moviemeter.%s
'
%
md5
(
self
.
rss_url
)
rss_data
=
self
.
getCache
(
cache_key
,
self
.
rss_url
)
data
=
XMLTree
.
fromstring
(
rss_data
)
if
data
is
not
None
:
rss_movies
=
self
.
getElements
(
data
,
'
channel/item
'
)
for
movie
in
rss_movies
:
name
=
self
.
getTextElement
(
movie
,
"
title
"
)
year
=
datetime
.
datetime
.
now
().
strftime
(
"
%Y
"
)
imdb
=
self
.
search
(
name
,
year
)
if
imdb
and
self
.
isMinimalMovie
(
imdb
):
movies
.
append
(
imdb
[
'
imdb
'
])
return
movies
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