diff --git a/lib/svtplay_dl/__init__.py b/lib/svtplay_dl/__init__.py index 065eb6d..5cc04bc 100644 --- a/lib/svtplay_dl/__init__.py +++ b/lib/svtplay_dl/__init__.py @@ -9,7 +9,7 @@ from optparse import OptionParser from svtplay_dl.log import log from svtplay_dl.utils import get_http_data -from svtplay_dl.service import service_handler +from svtplay_dl.service import service_handler, Generic __version__ = "0.9.2013.03.06" @@ -50,7 +50,9 @@ class Options: def get_media(url, options): stream = service_handler(url) - + if not stream: + url, stream = Generic().get(url) + url = url.replace("&", "&") if not stream: log.error("That site is not supported. Make a ticket or send a message") sys.exit(2) diff --git a/lib/svtplay_dl/service/__init__.py b/lib/svtplay_dl/service/__init__.py index c2504d6..d8b674b 100644 --- a/lib/svtplay_dl/service/__init__.py +++ b/lib/svtplay_dl/service/__init__.py @@ -1,6 +1,10 @@ # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- from __future__ import absolute_import +import re + +class Service(object): + pass from svtplay_dl.service.aftonbladet import Aftonbladet from svtplay_dl.service.dr import Dr @@ -18,6 +22,7 @@ from svtplay_dl.service.tv4play import Tv4play from svtplay_dl.service.urplay import Urplay from svtplay_dl.service.viaplay import Viaplay from svtplay_dl.service.vimeo import Vimeo +from svtplay_dl.utils import get_http_data sites = [ Aftonbladet(), @@ -37,12 +42,10 @@ sites = [ Viaplay(), Vimeo()] -class Service(object): - pass class Generic(object): ''' Videos embed in sites ''' - def get(self, sites, url): + def get(self, url): data = get_http_data(url) match = re.search("src=\"(http://www.svt.se/wd.*)\" frameborder", data) stream = None