mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-24 04:05:39 +01:00
Fix so embedded videos works again
This commit is contained in:
parent
0ae6ec8634
commit
01bb02ea68
@ -9,7 +9,7 @@ from optparse import OptionParser
|
|||||||
|
|
||||||
from svtplay_dl.log import log
|
from svtplay_dl.log import log
|
||||||
from svtplay_dl.utils import get_http_data
|
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"
|
__version__ = "0.9.2013.03.06"
|
||||||
@ -50,7 +50,9 @@ class Options:
|
|||||||
|
|
||||||
def get_media(url, options):
|
def get_media(url, options):
|
||||||
stream = service_handler(url)
|
stream = service_handler(url)
|
||||||
|
if not stream:
|
||||||
|
url, stream = Generic().get(url)
|
||||||
|
url = url.replace("&", "&")
|
||||||
if not stream:
|
if not stream:
|
||||||
log.error("That site is not supported. Make a ticket or send a message")
|
log.error("That site is not supported. Make a ticket or send a message")
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
# ex:ts=4:sw=4:sts=4:et
|
# ex:ts=4:sw=4:sts=4:et
|
||||||
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
import re
|
||||||
|
|
||||||
|
class Service(object):
|
||||||
|
pass
|
||||||
|
|
||||||
from svtplay_dl.service.aftonbladet import Aftonbladet
|
from svtplay_dl.service.aftonbladet import Aftonbladet
|
||||||
from svtplay_dl.service.dr import Dr
|
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.urplay import Urplay
|
||||||
from svtplay_dl.service.viaplay import Viaplay
|
from svtplay_dl.service.viaplay import Viaplay
|
||||||
from svtplay_dl.service.vimeo import Vimeo
|
from svtplay_dl.service.vimeo import Vimeo
|
||||||
|
from svtplay_dl.utils import get_http_data
|
||||||
|
|
||||||
sites = [
|
sites = [
|
||||||
Aftonbladet(),
|
Aftonbladet(),
|
||||||
@ -37,12 +42,10 @@ sites = [
|
|||||||
Viaplay(),
|
Viaplay(),
|
||||||
Vimeo()]
|
Vimeo()]
|
||||||
|
|
||||||
class Service(object):
|
|
||||||
pass
|
|
||||||
|
|
||||||
class Generic(object):
|
class Generic(object):
|
||||||
''' Videos embed in sites '''
|
''' Videos embed in sites '''
|
||||||
def get(self, sites, url):
|
def get(self, url):
|
||||||
data = get_http_data(url)
|
data = get_http_data(url)
|
||||||
match = re.search("src=\"(http://www.svt.se/wd.*)\" frameborder", data)
|
match = re.search("src=\"(http://www.svt.se/wd.*)\" frameborder", data)
|
||||||
stream = None
|
stream = None
|
||||||
|
Loading…
Reference in New Issue
Block a user