1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

picsearch: New service.

DN.se is using picsearch now days instead of qbrick
This commit is contained in:
Johan Andersson 2014-03-25 15:37:41 +01:00
parent 0659214816
commit 24dd893fca
3 changed files with 43 additions and 1 deletions

View File

@ -94,6 +94,7 @@ from svtplay_dl.service.kanal5 import Kanal5
from svtplay_dl.service.mtvservices import Mtvservices
from svtplay_dl.service.nrk import Nrk
from svtplay_dl.service.qbrick import Qbrick
from svtplay_dl.service.picsearch import Picsearch
from svtplay_dl.service.ruv import Ruv
from svtplay_dl.service.radioplay import Radioplay
from svtplay_dl.service.sr import Sr
@ -116,6 +117,7 @@ sites = [
Mtvservices,
Nrk,
Qbrick,
Picsearch,
Ruv,
Radioplay,
Sr,

View File

@ -0,0 +1,40 @@
# 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
import json
import sys
from svtplay_dl.service import Service, OpenGraphThumbMixin
from svtplay_dl.utils import get_http_data, select_quality
from svtplay_dl.fetcher.rtmp import download_rtmp
from svtplay_dl.fetcher.hls import download_hls
from svtplay_dl.log import log
class Picsearch(Service, OpenGraphThumbMixin):
supported_domains = ['dn.se']
def get(self, options):
data = self.get_urldata()
ajax_auth = re.search(r"picsearch_ajax_auth = '(\w+)'", data)
if not ajax_auth:
print "hej"
sys.exit(2)
mediaid = re.search(r"mediaId = '(\w+)';", data)
if not mediaid:
print "didi"
sys.exit(2)
jsondata = get_http_data("http://csp.picsearch.com/rest?jsonp=&eventParam=1&auth=%s&method=embed&mediaid=%s" % (ajax_auth.group(1), mediaid.group(1)))
jsondata = json.loads(jsondata)
#print jsondata
files = jsondata["media"]["playerconfig"]["playlist"][1]["bitrates"]
server = jsondata["media"]["playerconfig"]["plugins"]["bwcheck"]["netConnectionUrl"]
streams = {}
for i in files:
streams[int(i["height"])] = i["url"]
path = select_quality(options, streams)
options.other = "-y '%s'" % path
download_rtmp(options, server)

View File

@ -12,7 +12,7 @@ from svtplay_dl.log import log
from svtplay_dl.fetcher.rtmp import download_rtmp
class Qbrick(Service, OpenGraphThumbMixin):
supported_domains = ['dn.se', 'di.se', 'svd.se', 'sydsvenskan.se']
supported_domains = ['di.se', 'svd.se', 'sydsvenskan.se']
def get(self, options):
if re.findall(r"sydsvenskan.se", self.url):