mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-12-02 16:14:15 +01:00
Rename module from lib/svtplay to lib/svtplay_dl
less confusion with the service.
This commit is contained in:
parent
cbf100139c
commit
cfd20232ab
@ -13,8 +13,8 @@ from datetime import timedelta
|
|||||||
|
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
from svtplay.output import progressbar, progress_stream
|
from svtplay_dl.output import progressbar, progress_stream
|
||||||
from svtplay.utils import get_http_data, select_quality
|
from svtplay_dl.utils import get_http_data, select_quality
|
||||||
|
|
||||||
log = logging.getLogger('svtplay_dl')
|
log = logging.getLogger('svtplay_dl')
|
||||||
|
|
@ -7,9 +7,9 @@ import re
|
|||||||
import time
|
import time
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from svtplay.utils import get_http_data, select_quality
|
from svtplay_dl.utils import get_http_data, select_quality
|
||||||
from svtplay.output import progressbar, progress_stream
|
from svtplay_dl.output import progressbar, progress_stream
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
|
|
||||||
if sys.version_info > (3, 0):
|
if sys.version_info > (3, 0):
|
||||||
from io import BytesIO as StringIO
|
from io import BytesIO as StringIO
|
@ -5,8 +5,8 @@ import sys
|
|||||||
import time
|
import time
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from svtplay.output import progress # FIXME use progressbar() instead
|
from svtplay_dl.output import progress # FIXME use progressbar() instead
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
|
|
||||||
if sys.version_info > (3, 0):
|
if sys.version_info > (3, 0):
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
@ -6,7 +6,7 @@ import re
|
|||||||
import shlex
|
import shlex
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
|
|
||||||
def download_rtmp(options, url):
|
def download_rtmp(options, url):
|
||||||
""" Get the stream from RTMP """
|
""" Get the stream from RTMP """
|
@ -24,22 +24,22 @@ class Generic(object):
|
|||||||
return match.group(1), i
|
return match.group(1), i
|
||||||
return url, stream
|
return url, stream
|
||||||
|
|
||||||
from svtplay.service.aftonbladet import Aftonbladet
|
from svtplay_dl.service.aftonbladet import Aftonbladet
|
||||||
from svtplay.service.dr import Dr
|
from svtplay_dl.service.dr import Dr
|
||||||
from svtplay.service.expressen import Expressen
|
from svtplay_dl.service.expressen import Expressen
|
||||||
from svtplay.service.hbo import Hbo
|
from svtplay_dl.service.hbo import Hbo
|
||||||
from svtplay.service.justin import Justin
|
from svtplay_dl.service.justin import Justin
|
||||||
from svtplay.service.kanal5 import Kanal5
|
from svtplay_dl.service.kanal5 import Kanal5
|
||||||
from svtplay.service.nrk import Nrk
|
from svtplay_dl.service.nrk import Nrk
|
||||||
from svtplay.service.qbrick import Qbrick
|
from svtplay_dl.service.qbrick import Qbrick
|
||||||
from svtplay.service.ruv import Ruv
|
from svtplay_dl.service.ruv import Ruv
|
||||||
from svtplay.service.radioplay import Radioplay
|
from svtplay_dl.service.radioplay import Radioplay
|
||||||
from svtplay.service.sr import Sr
|
from svtplay_dl.service.sr import Sr
|
||||||
from svtplay.service.svtplay import Svtplay
|
from svtplay_dl.service.svtplay import Svtplay
|
||||||
from svtplay.service.tv4play import Tv4play
|
from svtplay_dl.service.tv4play import Tv4play
|
||||||
from svtplay.service.urplay import Urplay
|
from svtplay_dl.service.urplay import Urplay
|
||||||
from svtplay.service.viaplay import Viaplay
|
from svtplay_dl.service.viaplay import Viaplay
|
||||||
from svtplay.service.vimeo import Vimeo
|
from svtplay_dl.service.vimeo import Vimeo
|
||||||
|
|
||||||
|
|
||||||
def service_handler(url):
|
def service_handler(url):
|
@ -5,10 +5,10 @@ import sys
|
|||||||
import re
|
import re
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
from svtplay.utils import get_http_data
|
from svtplay_dl.utils import get_http_data
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
from svtplay.fetcher.rtmp import download_rtmp
|
from svtplay_dl.fetcher.rtmp import download_rtmp
|
||||||
from svtplay.fetcher.http import download_http
|
from svtplay_dl.fetcher.http import download_http
|
||||||
|
|
||||||
if sys.version_info > (3, 0):
|
if sys.version_info > (3, 0):
|
||||||
from urllib.parse import urlparse, parse_qs
|
from urllib.parse import urlparse, parse_qs
|
@ -4,8 +4,8 @@ from __future__ import absolute_import
|
|||||||
import re
|
import re
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from svtplay.utils import get_http_data, select_quality
|
from svtplay_dl.utils import get_http_data, select_quality
|
||||||
from svtplay.fetcher.rtmp import download_rtmp
|
from svtplay_dl.fetcher.rtmp import download_rtmp
|
||||||
|
|
||||||
class Dr(object):
|
class Dr(object):
|
||||||
def handle(self, url):
|
def handle(self, url):
|
@ -5,9 +5,9 @@ import sys
|
|||||||
import re
|
import re
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
from svtplay.utils import get_http_data, select_quality
|
from svtplay_dl.utils import get_http_data, select_quality
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
from svtplay.fetcher.rtmp import download_rtmp
|
from svtplay_dl.fetcher.rtmp import download_rtmp
|
||||||
|
|
||||||
if sys.version_info > (3, 0):
|
if sys.version_info > (3, 0):
|
||||||
from urllib.parse import urlparse, parse_qs, unquote_plus, quote_plus
|
from urllib.parse import urlparse, parse_qs, unquote_plus, quote_plus
|
@ -6,9 +6,9 @@ import re
|
|||||||
from urlparse import urlparse
|
from urlparse import urlparse
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
from svtplay.utils import get_http_data, select_quality
|
from svtplay_dl.utils import get_http_data, select_quality
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
from svtplay.fetcher.rtmp import download_rtmp
|
from svtplay_dl.fetcher.rtmp import download_rtmp
|
||||||
|
|
||||||
class Hbo():
|
class Hbo():
|
||||||
def handle(self, url):
|
def handle(self, url):
|
@ -6,10 +6,10 @@ import re
|
|||||||
from urlparse import urlparse
|
from urlparse import urlparse
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
from svtplay.utils import get_http_data, select_quality
|
from svtplay_dl.utils import get_http_data, select_quality
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
from svtplay.fetcher.rtmp import download_rtmp
|
from svtplay_dl.fetcher.rtmp import download_rtmp
|
||||||
from svtplay.fetcher.http import download_http
|
from svtplay_dl.fetcher.http import download_http
|
||||||
|
|
||||||
class Justin():
|
class Justin():
|
||||||
def handle(self, url):
|
def handle(self, url):
|
@ -10,9 +10,9 @@ if sys.version_info > (3, 0):
|
|||||||
else:
|
else:
|
||||||
from cookielib import CookieJar, Cookie
|
from cookielib import CookieJar, Cookie
|
||||||
|
|
||||||
from svtplay.utils import get_http_data, select_quality
|
from svtplay_dl.utils import get_http_data, select_quality
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
from svtplay.fetcher.rtmp import download_rtmp
|
from svtplay_dl.fetcher.rtmp import download_rtmp
|
||||||
|
|
||||||
class Kanal5():
|
class Kanal5():
|
||||||
def handle(self, url):
|
def handle(self, url):
|
@ -3,9 +3,9 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from svtplay.utils import get_http_data
|
from svtplay_dl.utils import get_http_data
|
||||||
from svtplay.fetcher.hds import download_hds
|
from svtplay_dl.fetcher.hds import download_hds
|
||||||
from svtplay.fetcher.hls import download_hls
|
from svtplay_dl.fetcher.hls import download_hls
|
||||||
|
|
||||||
class Nrk(object):
|
class Nrk(object):
|
||||||
def handle(self, url):
|
def handle(self, url):
|
@ -5,9 +5,9 @@ import sys
|
|||||||
import re
|
import re
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
from svtplay.utils import get_http_data, select_quality
|
from svtplay_dl.utils import get_http_data, select_quality
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
from svtplay.fetcher.rtmp import download_rtmp
|
from svtplay_dl.fetcher.rtmp import download_rtmp
|
||||||
|
|
||||||
class Qbrick():
|
class Qbrick():
|
||||||
def handle(self, url):
|
def handle(self, url):
|
@ -4,13 +4,13 @@ import re
|
|||||||
import json
|
import json
|
||||||
from urlparse import urlparse
|
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_dl.fetcher.rtmp import download_rtmp
|
||||||
from svtplay.fetcher.hls import download_hls
|
from svtplay_dl.fetcher.hls import download_hls
|
||||||
from svtplay.fetcher.http import download_http
|
from svtplay_dl.fetcher.http import download_http
|
||||||
|
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
|
|
||||||
class Radioplay(object):
|
class Radioplay(object):
|
||||||
def handle(self, url):
|
def handle(self, url):
|
@ -3,8 +3,8 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from svtplay.utils import get_http_data
|
from svtplay_dl.utils import get_http_data
|
||||||
from svtplay.fetcher.hls import download_hls
|
from svtplay_dl.fetcher.hls import download_hls
|
||||||
|
|
||||||
class Ruv(object):
|
class Ruv(object):
|
||||||
def handle(self, url):
|
def handle(self, url):
|
@ -5,9 +5,9 @@ import sys
|
|||||||
import re
|
import re
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
from svtplay.utils import get_http_data
|
from svtplay_dl.utils import get_http_data
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
from svtplay.fetcher.http import download_http
|
from svtplay_dl.fetcher.http import download_http
|
||||||
|
|
||||||
if sys.version_info > (3, 0):
|
if sys.version_info > (3, 0):
|
||||||
from urllib.parse import urlparse, parse_qs, unquote_plus
|
from urllib.parse import urlparse, parse_qs, unquote_plus
|
@ -5,15 +5,15 @@ import sys
|
|||||||
import re
|
import re
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from svtplay.service import Service
|
from svtplay_dl.service import Service
|
||||||
from svtplay.utils import get_http_data, select_quality
|
from svtplay_dl.utils import get_http_data, select_quality
|
||||||
|
|
||||||
from svtplay.fetcher.hds import download_hds
|
from svtplay_dl.fetcher.hds import download_hds
|
||||||
from svtplay.fetcher.hls import download_hls
|
from svtplay_dl.fetcher.hls import download_hls
|
||||||
from svtplay.fetcher.rtmp import download_rtmp
|
from svtplay_dl.fetcher.rtmp import download_rtmp
|
||||||
from svtplay.fetcher.http import download_http
|
from svtplay_dl.fetcher.http import download_http
|
||||||
|
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
|
|
||||||
class Svtplay(Service):
|
class Svtplay(Service):
|
||||||
def handle(self, url):
|
def handle(self, url):
|
@ -5,10 +5,10 @@ import sys
|
|||||||
import re
|
import re
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
from svtplay.utils import get_http_data, select_quality
|
from svtplay_dl.utils import get_http_data, select_quality
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
from svtplay.fetcher.rtmp import download_rtmp
|
from svtplay_dl.fetcher.rtmp import download_rtmp
|
||||||
from svtplay.fetcher.hds import download_hds
|
from svtplay_dl.fetcher.hds import download_hds
|
||||||
|
|
||||||
if sys.version_info > (3, 0):
|
if sys.version_info > (3, 0):
|
||||||
from urllib.parse import urlparse, parse_qs
|
from urllib.parse import urlparse, parse_qs
|
@ -4,10 +4,10 @@ from __future__ import absolute_import
|
|||||||
import re
|
import re
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from svtplay.utils import get_http_data
|
from svtplay_dl.utils import get_http_data
|
||||||
from svtplay.fetcher.rtmp import download_rtmp
|
from svtplay_dl.fetcher.rtmp import download_rtmp
|
||||||
from svtplay.fetcher.hds import download_hds
|
from svtplay_dl.fetcher.hds import download_hds
|
||||||
from svtplay.fetcher.hls import download_hls
|
from svtplay_dl.fetcher.hls import download_hls
|
||||||
|
|
||||||
class Urplay():
|
class Urplay():
|
||||||
def handle(self, url):
|
def handle(self, url):
|
@ -6,9 +6,9 @@ import re
|
|||||||
from urlparse import urlparse
|
from urlparse import urlparse
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
from svtplay.utils import get_http_data
|
from svtplay_dl.utils import get_http_data
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
from svtplay.fetcher.rtmp import download_rtmp
|
from svtplay_dl.fetcher.rtmp import download_rtmp
|
||||||
|
|
||||||
class Viaplay():
|
class Viaplay():
|
||||||
def handle(self, url):
|
def handle(self, url):
|
@ -4,9 +4,9 @@ from __future__ import absolute_import
|
|||||||
import sys
|
import sys
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from svtplay.utils import get_http_data
|
from svtplay_dl.utils import get_http_data
|
||||||
from svtplay.fetcher.http import download_http
|
from svtplay_dl.fetcher.http import download_http
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
|
|
||||||
class Vimeo(object):
|
class Vimeo(object):
|
||||||
def handle(self, url):
|
def handle(self, url):
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
import unittest
|
import unittest
|
||||||
import svtplay.output
|
import svtplay_dl.output
|
||||||
|
|
||||||
class mockfile(object):
|
class mockfile(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -22,45 +22,45 @@ class mockfile(object):
|
|||||||
class progressbarTest(unittest.TestCase):
|
class progressbarTest(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.mockfile = mockfile()
|
self.mockfile = mockfile()
|
||||||
svtplay.output.progress_stream = self.mockfile
|
svtplay_dl.output.progress_stream = self.mockfile
|
||||||
|
|
||||||
def test_0_100(self):
|
def test_0_100(self):
|
||||||
svtplay.output.progressbar(100, 0)
|
svtplay_dl.output.progressbar(100, 0)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.mockfile.read(),
|
self.mockfile.read(),
|
||||||
"\r[000/100][..................................................] "
|
"\r[000/100][..................................................] "
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_progress_1_100(self):
|
def test_progress_1_100(self):
|
||||||
svtplay.output.progressbar(100, 1)
|
svtplay_dl.output.progressbar(100, 1)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.mockfile.read(),
|
self.mockfile.read(),
|
||||||
"\r[001/100][..................................................] "
|
"\r[001/100][..................................................] "
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_progress_2_100(self):
|
def test_progress_2_100(self):
|
||||||
svtplay.output.progressbar(100, 2)
|
svtplay_dl.output.progressbar(100, 2)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.mockfile.read(),
|
self.mockfile.read(),
|
||||||
"\r[002/100][=.................................................] "
|
"\r[002/100][=.................................................] "
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_progress_50_100(self):
|
def test_progress_50_100(self):
|
||||||
svtplay.output.progressbar(100, 50)
|
svtplay_dl.output.progressbar(100, 50)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.mockfile.read(),
|
self.mockfile.read(),
|
||||||
"\r[050/100][=========================.........................] "
|
"\r[050/100][=========================.........................] "
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_progress_100_100(self):
|
def test_progress_100_100(self):
|
||||||
svtplay.output.progressbar(100, 100)
|
svtplay_dl.output.progressbar(100, 100)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.mockfile.read(),
|
self.mockfile.read(),
|
||||||
"\r[100/100][==================================================] "
|
"\r[100/100][==================================================] "
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_progress_20_100_msg(self):
|
def test_progress_20_100_msg(self):
|
||||||
svtplay.output.progressbar(100, 20, "msg")
|
svtplay_dl.output.progressbar(100, 20, "msg")
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.mockfile.read(),
|
self.mockfile.read(),
|
||||||
"\r[020/100][==========........................................] msg"
|
"\r[020/100][==========........................................] msg"
|
@ -8,9 +8,9 @@ import os
|
|||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from svtplay.log import log
|
from svtplay_dl.log import log
|
||||||
from svtplay.utils import get_http_data
|
from svtplay_dl.utils import get_http_data
|
||||||
from svtplay.service import service_handler
|
from svtplay_dl.service import service_handler
|
||||||
|
|
||||||
|
|
||||||
__version__ = "0.9.2013.03.06"
|
__version__ = "0.9.2013.03.06"
|
||||||
|
1472
svtplay_dl.py
1472
svtplay_dl.py
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user