Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sick-Beard
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
Sick-Beard
Commits
1b3faac0
Commit
1b3faac0
authored
Jul 17, 2014
by
on
Browse files
Options
Downloads
Patches
Plain Diff
Signed-off-by: on <raver2046@gmail.com>
parent
310aea6d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
data/images/providers/thinkgeek.png
+0
-0
0 additions, 0 deletions
data/images/providers/thinkgeek.png
sickbeard/providers/thinkgeek.py
+93
-0
93 additions, 0 deletions
sickbeard/providers/thinkgeek.py
with
93 additions
and
0 deletions
data/images/providers/thinkgeek.png
0 → 100644
+
0
−
0
View file @
1b3faac0
1012 B
This diff is collapsed.
Click to expand it.
sickbeard/providers/thinkgeek.py
0 → 100644
+
93
−
0
View file @
1b3faac0
# Author: Olivier N. <raver2046@gmail.com>
# URL: https://github.com/sarakha63/Sick-Beard
#
# This file is based upon tvtorrents.py.
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Sick Beard is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Sick Beard. If not, see <http://www.gnu.org/licenses/>.
import
sickbeard
import
generic
from
sickbeard
import
helpers
,
logger
,
exceptions
,
tvcache
from
lib.tvdb_api
import
tvdb_api
,
tvdb_exceptions
from
sickbeard.name_parser.parser
import
NameParser
,
InvalidNameException
class
thinkgeekProvider
(
generic
.
TorrentProvider
):
def
__init__
(
self
):
generic
.
TorrentProvider
.
__init__
(
self
,
"
thinkgeek
"
)
self
.
supportsBacklog
=
False
self
.
cache
=
thinkgeekCache
(
self
)
self
.
url
=
'
http://think-geek.net/
'
def
isEnabled
(
self
):
return
sickbeard
.
thinkgeek
def
imageName
(
self
):
return
'
thinkgeek.png
'
class
thinkgeekCache
(
tvcache
.
TVCache
):
def
__init__
(
self
,
provider
):
tvcache
.
TVCache
.
__init__
(
self
,
provider
)
# only poll every 15 minutes
self
.
minTime
=
15
def
_getRSSData
(
self
):
if
not
sickbeard
.
thinkgeek_KEY
:
raise
exceptions
.
AuthException
(
"
thinkgeek requires an API key to work correctly
"
)
url
=
'
https://think-geek.net/?p=rss&categories=33,34,61,62&pk=
'
+
sickbeard
.
thinkgeek_KEY
logger
.
log
(
u
"
thinkgeek cache update URL:
"
+
url
,
logger
.
DEBUG
)
data
=
self
.
provider
.
getURL
(
url
)
return
data
def
_parseItem
(
self
,
item
):
ltvdb_api_parms
=
sickbeard
.
TVDB_API_PARMS
.
copy
()
ltvdb_api_parms
[
'
search_all_languages
'
]
=
True
(
title
,
url
)
=
self
.
provider
.
_get_title_and_url
(
item
)
if
not
title
or
not
url
:
logger
.
log
(
u
"
The XML returned from the thinkgeek RSS feed is incomplete, this result is unusable
"
,
logger
.
ERROR
)
return
try
:
myParser
=
NameParser
()
parse_result
=
myParser
.
parse
(
title
)
except
InvalidNameException
:
logger
.
log
(
u
"
Unable to parse the filename
"
+
title
+
"
into a valid episode
"
,
logger
.
DEBUG
)
return
try
:
t
=
tvdb_api
.
Tvdb
(
**
ltvdb_api_parms
)
showObj
=
t
[
parse_result
.
series_name
]
except
tvdb_exceptions
.
tvdb_error
:
logger
.
log
(
u
"
TVDB timed out, unable to update episodes from TVDB
"
,
logger
.
ERROR
)
return
logger
.
log
(
u
"
Adding item from RSS to cache:
"
+
title
,
logger
.
DEBUG
)
self
.
_addCacheEntry
(
name
=
title
,
url
=
url
,
tvdb_id
=
showObj
[
'
id
'
])
provider
=
thinkgeekProvider
()
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