1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-30 15:14:14 +01:00

Rename module from lib/svtplay to lib/svtplay_dl

less confusion with the service.
This commit is contained in:
Johan Andersson 2013-03-17 19:55:19 +01:00
parent cbf100139c
commit cfd20232ab
30 changed files with 91 additions and 1563 deletions

View File

@ -13,8 +13,8 @@ from datetime import timedelta
import xml.etree.ElementTree as ET
from svtplay.output import progressbar, progress_stream
from svtplay.utils import get_http_data, select_quality
from svtplay_dl.output import progressbar, progress_stream
from svtplay_dl.utils import get_http_data, select_quality
log = logging.getLogger('svtplay_dl')

View File

@ -7,9 +7,9 @@ import re
import time
from datetime import timedelta
from svtplay.utils import get_http_data, select_quality
from svtplay.output import progressbar, progress_stream
from svtplay.log import log
from svtplay_dl.utils import get_http_data, select_quality
from svtplay_dl.output import progressbar, progress_stream
from svtplay_dl.log import log
if sys.version_info > (3, 0):
from io import BytesIO as StringIO

View File

@ -5,8 +5,8 @@ import sys
import time
import re
from svtplay.output import progress # FIXME use progressbar() instead
from svtplay.log import log
from svtplay_dl.output import progress # FIXME use progressbar() instead
from svtplay_dl.log import log
if sys.version_info > (3, 0):
from urllib.request import urlopen

View File

@ -6,7 +6,7 @@ import re
import shlex
import sys
from svtplay.log import log
from svtplay_dl.log import log
def download_rtmp(options, url):
""" Get the stream from RTMP """

View File

@ -24,22 +24,22 @@ class Generic(object):
return match.group(1), i
return url, stream
from svtplay.service.aftonbladet import Aftonbladet
from svtplay.service.dr import Dr
from svtplay.service.expressen import Expressen
from svtplay.service.hbo import Hbo
from svtplay.service.justin import Justin
from svtplay.service.kanal5 import Kanal5
from svtplay.service.nrk import Nrk
from svtplay.service.qbrick import Qbrick
from svtplay.service.ruv import Ruv
from svtplay.service.radioplay import Radioplay
from svtplay.service.sr import Sr
from svtplay.service.svtplay import Svtplay
from svtplay.service.tv4play import Tv4play
from svtplay.service.urplay import Urplay
from svtplay.service.viaplay import Viaplay
from svtplay.service.vimeo import Vimeo
from svtplay_dl.service.aftonbladet import Aftonbladet
from svtplay_dl.service.dr import Dr
from svtplay_dl.service.expressen import Expressen
from svtplay_dl.service.hbo import Hbo
from svtplay_dl.service.justin import Justin
from svtplay_dl.service.kanal5 import Kanal5
from svtplay_dl.service.nrk import Nrk
from svtplay_dl.service.qbrick import Qbrick
from svtplay_dl.service.ruv import Ruv
from svtplay_dl.service.radioplay import Radioplay
from svtplay_dl.service.sr import Sr
from svtplay_dl.service.svtplay import Svtplay
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
def service_handler(url):

View File

@ -5,10 +5,10 @@ import sys
import re
import xml.etree.ElementTree as ET
from svtplay.utils import get_http_data
from svtplay.log import log
from svtplay.fetcher.rtmp import download_rtmp
from svtplay.fetcher.http import download_http
from svtplay_dl.utils import get_http_data
from svtplay_dl.log import log
from svtplay_dl.fetcher.rtmp import download_rtmp
from svtplay_dl.fetcher.http import download_http
if sys.version_info > (3, 0):
from urllib.parse import urlparse, parse_qs

View File

@ -4,8 +4,8 @@ from __future__ import absolute_import
import re
import json
from svtplay.utils import get_http_data, select_quality
from svtplay.fetcher.rtmp import download_rtmp
from svtplay_dl.utils import get_http_data, select_quality
from svtplay_dl.fetcher.rtmp import download_rtmp
class Dr(object):
def handle(self, url):

View File

@ -5,9 +5,9 @@ import sys
import re
import xml.etree.ElementTree as ET
from svtplay.utils import get_http_data, select_quality
from svtplay.log import log
from svtplay.fetcher.rtmp import download_rtmp
from svtplay_dl.utils import get_http_data, select_quality
from svtplay_dl.log import log
from svtplay_dl.fetcher.rtmp import download_rtmp
if sys.version_info > (3, 0):
from urllib.parse import urlparse, parse_qs, unquote_plus, quote_plus

View File

@ -6,9 +6,9 @@ import re
from urlparse import urlparse
import xml.etree.ElementTree as ET
from svtplay.utils import get_http_data, select_quality
from svtplay.log import log
from svtplay.fetcher.rtmp import download_rtmp
from svtplay_dl.utils import get_http_data, select_quality
from svtplay_dl.log import log
from svtplay_dl.fetcher.rtmp import download_rtmp
class Hbo():
def handle(self, url):

View File

@ -6,10 +6,10 @@ import re
from urlparse import urlparse
import xml.etree.ElementTree as ET
from svtplay.utils import get_http_data, select_quality
from svtplay.log import log
from svtplay.fetcher.rtmp import download_rtmp
from svtplay.fetcher.http import download_http
from svtplay_dl.utils import get_http_data, select_quality
from svtplay_dl.log import log
from svtplay_dl.fetcher.rtmp import download_rtmp
from svtplay_dl.fetcher.http import download_http
class Justin():
def handle(self, url):

View File

@ -10,9 +10,9 @@ if sys.version_info > (3, 0):
else:
from cookielib import CookieJar, Cookie
from svtplay.utils import get_http_data, select_quality
from svtplay.log import log
from svtplay.fetcher.rtmp import download_rtmp
from svtplay_dl.utils import get_http_data, select_quality
from svtplay_dl.log import log
from svtplay_dl.fetcher.rtmp import download_rtmp
class Kanal5():
def handle(self, url):

View File

@ -3,9 +3,9 @@
from __future__ import absolute_import
import re
from svtplay.utils import get_http_data
from svtplay.fetcher.hds import download_hds
from svtplay.fetcher.hls import download_hls
from svtplay_dl.utils import get_http_data
from svtplay_dl.fetcher.hds import download_hds
from svtplay_dl.fetcher.hls import download_hls
class Nrk(object):
def handle(self, url):

View File

@ -5,9 +5,9 @@ import sys
import re
import xml.etree.ElementTree as ET
from svtplay.utils import get_http_data, select_quality
from svtplay.log import log
from svtplay.fetcher.rtmp import download_rtmp
from svtplay_dl.utils import get_http_data, select_quality
from svtplay_dl.log import log
from svtplay_dl.fetcher.rtmp import download_rtmp
class Qbrick():
def handle(self, url):

View File

@ -4,13 +4,13 @@ import re
import json
from urlparse import urlparse
from svtplay.utils import get_http_data
from svtplay_dl.utils import get_http_data
from svtplay.fetcher.rtmp import download_rtmp
from svtplay.fetcher.hls import download_hls
from svtplay.fetcher.http import download_http
from svtplay_dl.fetcher.rtmp import download_rtmp
from svtplay_dl.fetcher.hls import download_hls
from svtplay_dl.fetcher.http import download_http
from svtplay.log import log
from svtplay_dl.log import log
class Radioplay(object):
def handle(self, url):

View File

@ -3,8 +3,8 @@
from __future__ import absolute_import
import re
from svtplay.utils import get_http_data
from svtplay.fetcher.hls import download_hls
from svtplay_dl.utils import get_http_data
from svtplay_dl.fetcher.hls import download_hls
class Ruv(object):
def handle(self, url):

View File

@ -5,9 +5,9 @@ import sys
import re
import xml.etree.ElementTree as ET
from svtplay.utils import get_http_data
from svtplay.log import log
from svtplay.fetcher.http import download_http
from svtplay_dl.utils import get_http_data
from svtplay_dl.log import log
from svtplay_dl.fetcher.http import download_http
if sys.version_info > (3, 0):
from urllib.parse import urlparse, parse_qs, unquote_plus

View File

@ -5,15 +5,15 @@ import sys
import re
import json
from svtplay.service import Service
from svtplay.utils import get_http_data, select_quality
from svtplay_dl.service import Service
from svtplay_dl.utils import get_http_data, select_quality
from svtplay.fetcher.hds import download_hds
from svtplay.fetcher.hls import download_hls
from svtplay.fetcher.rtmp import download_rtmp
from svtplay.fetcher.http import download_http
from svtplay_dl.fetcher.hds import download_hds
from svtplay_dl.fetcher.hls import download_hls
from svtplay_dl.fetcher.rtmp import download_rtmp
from svtplay_dl.fetcher.http import download_http
from svtplay.log import log
from svtplay_dl.log import log
class Svtplay(Service):
def handle(self, url):

View File

@ -5,10 +5,10 @@ import sys
import re
import xml.etree.ElementTree as ET
from svtplay.utils import get_http_data, select_quality
from svtplay.log import log
from svtplay.fetcher.rtmp import download_rtmp
from svtplay.fetcher.hds import download_hds
from svtplay_dl.utils import get_http_data, select_quality
from svtplay_dl.log import log
from svtplay_dl.fetcher.rtmp import download_rtmp
from svtplay_dl.fetcher.hds import download_hds
if sys.version_info > (3, 0):
from urllib.parse import urlparse, parse_qs

View File

@ -4,10 +4,10 @@ from __future__ import absolute_import
import re
import json
from svtplay.utils import get_http_data
from svtplay.fetcher.rtmp import download_rtmp
from svtplay.fetcher.hds import download_hds
from svtplay.fetcher.hls import download_hls
from svtplay_dl.utils import get_http_data
from svtplay_dl.fetcher.rtmp import download_rtmp
from svtplay_dl.fetcher.hds import download_hds
from svtplay_dl.fetcher.hls import download_hls
class Urplay():
def handle(self, url):

View File

@ -6,9 +6,9 @@ import re
from urlparse import urlparse
import xml.etree.ElementTree as ET
from svtplay.utils import get_http_data
from svtplay.log import log
from svtplay.fetcher.rtmp import download_rtmp
from svtplay_dl.utils import get_http_data
from svtplay_dl.log import log
from svtplay_dl.fetcher.rtmp import download_rtmp
class Viaplay():
def handle(self, url):

View File

@ -4,9 +4,9 @@ from __future__ import absolute_import
import sys
import json
from svtplay.utils import get_http_data
from svtplay.fetcher.http import download_http
from svtplay.log import log
from svtplay_dl.utils import get_http_data
from svtplay_dl.fetcher.http import download_http
from svtplay_dl.log import log
class Vimeo(object):
def handle(self, url):

View File

@ -7,7 +7,7 @@
from __future__ import absolute_import
import unittest
import svtplay.output
import svtplay_dl.output
class mockfile(object):
def __init__(self):
@ -22,45 +22,45 @@ class mockfile(object):
class progressbarTest(unittest.TestCase):
def setUp(self):
self.mockfile = mockfile()
svtplay.output.progress_stream = self.mockfile
svtplay_dl.output.progress_stream = self.mockfile
def test_0_100(self):
svtplay.output.progressbar(100, 0)
svtplay_dl.output.progressbar(100, 0)
self.assertEqual(
self.mockfile.read(),
"\r[000/100][..................................................] "
)
def test_progress_1_100(self):
svtplay.output.progressbar(100, 1)
svtplay_dl.output.progressbar(100, 1)
self.assertEqual(
self.mockfile.read(),
"\r[001/100][..................................................] "
)
def test_progress_2_100(self):
svtplay.output.progressbar(100, 2)
svtplay_dl.output.progressbar(100, 2)
self.assertEqual(
self.mockfile.read(),
"\r[002/100][=.................................................] "
)
def test_progress_50_100(self):
svtplay.output.progressbar(100, 50)
svtplay_dl.output.progressbar(100, 50)
self.assertEqual(
self.mockfile.read(),
"\r[050/100][=========================.........................] "
)
def test_progress_100_100(self):
svtplay.output.progressbar(100, 100)
svtplay_dl.output.progressbar(100, 100)
self.assertEqual(
self.mockfile.read(),
"\r[100/100][==================================================] "
)
def test_progress_20_100_msg(self):
svtplay.output.progressbar(100, 20, "msg")
svtplay_dl.output.progressbar(100, 20, "msg")
self.assertEqual(
self.mockfile.read(),
"\r[020/100][==========........................................] msg"

View File

@ -8,9 +8,9 @@ import os
from optparse import OptionParser
import logging
from svtplay.log import log
from svtplay.utils import get_http_data
from svtplay.service import service_handler
from svtplay_dl.log import log
from svtplay_dl.utils import get_http_data
from svtplay_dl.service import service_handler
__version__ = "0.9.2013.03.06"

File diff suppressed because it is too large Load Diff