Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #1513

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ svtplay-dl is available in Debian strech and later and on Ubuntu 16.04 and later

### Solus

svtplay-dl is avaliable in the [Solus](https://getsol.us.com/) repository and can be installed by simply running:
svtplay-dl is available in the [Solus](https://getsol.us.com/) repository and can be installed by simply running:

```
sudo eopkg it svtplay-dl
Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ServiceError(Exception):

class NoRequestedProtocols(UIException):
"""
This excpetion is thrown when the service provides streams,
This exception is thrown when the service provides streams,
but not using any accepted protocol (as decided by
options.stream_prio).
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/fetcher/hls.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def random_iv():
if "EXT-X-KEY" in i:
keyurl = get_full_url(i["EXT-X-KEY"]["URI"], url)
if keyurl and keyurl[:4] == "skd:":
raise HLSException(keyurl, "Can't decrypt beacuse of DRM")
raise HLSException(keyurl, "Can't decrypt because of DRM")
key = self.http.request("get", keyurl, cookies=keycookies, headers=headers).content
iv = binascii.unhexlify(i["EXT-X-KEY"]["IV"][2:].zfill(32)) if "IV" in i["EXT-X-KEY"] else random_iv()
backend = default_backend()
Expand Down
4 changes: 2 additions & 2 deletions lib/svtplay_dl/postprocess/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, stream, config, subfixes=None):

def merge(self):
if self.detect is None:
logging.error("Cant detect ffmpeg or avconv. Cant mux files without it.")
logging.error("Can't detect ffmpeg or avconv. Can't mux files without it.")
return
if self.stream.finished is False:
return
Expand Down Expand Up @@ -92,7 +92,7 @@ def merge(self):
subs_nr = 0
sub_start = 0
# find what sub track to start with. when a/v is in one file it start with 1
# if seperate it will start with 2
# if separate it will start with 2
for i in tracks:
if int(i[0]) >= sub_start:
sub_start += 1
Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/disney.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get(self):
if entry in jsondata["idlist"]:
entryid = jsondata["idlist"][entry]
else:
yield ServiceError("Cant find video info")
yield ServiceError("Can't find video info")
return
for i in jsondata["playlists"][0]["playlist"]:
if entryid in i["id"]:
Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/dr.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get(self):
if not match:
match = re.search('source src="([^"]+)"', data)
if not match:
yield ServiceError("Cant find info for this video")
yield ServiceError("Can't find info for this video")
return

res = self.http.request("get", match.group(1))
Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/efn.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Efn(Service, OpenGraphThumbMixin):
def get(self):
match = re.search('data-hls="([^"]+)"', self.get_urldata())
if not match:
yield ServiceError("Cant find video info")
yield ServiceError("Can't find video info")
return

yield from hlsparse(self.config, self.http.request("get", match.group(1)), match.group(1), output=self.output)
6 changes: 3 additions & 3 deletions lib/svtplay_dl/service/eurosport.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get(self):
parse = urlparse(self.url)
match = re.search("window.server_path = ({.*});", self.get_urldata())
if not match:
yield ServiceError("Cant find api key")
yield ServiceError("Can't find api key")
return

janson = json.loads(match.group(1))
Expand Down Expand Up @@ -73,7 +73,7 @@ def get(self):
pagetype = "channel"
match = re.search("/([^/]+)$", parse.path)
if not match:
yield ServiceError("Cant find channel")
yield ServiceError("Can't find channel")
return

(vid,) = match.groups()
Expand All @@ -97,7 +97,7 @@ def get(self):
pagetype = "event"
match = re.search("/([^/]+)/([^/]+)$", parse.path)
if not match:
yield ServiceError("Cant fint event id")
yield ServiceError("Can't fint event id")
return

query["title"], query["contentId"] = match.groups()
Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/expressen.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get(self):

match = re.search('data-article-data="([^"]+)"', data)
if not match:
yield ServiceError("Cant find video file info")
yield ServiceError("Can't find video file info")
return
data = decode_html_entities(match.group(1))
janson = json.loads(data)
Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/facebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get(self):

match = re.search('params","([^"]+)"', data)
if not match:
yield ServiceError("Cant find params info. video need to be public.")
yield ServiceError("Can't find params info. video need to be public.")
return
data2 = json.loads(f'["{match.group(1)}"]')
data2 = json.loads(unquote_plus(data2[0]))
Expand Down
4 changes: 2 additions & 2 deletions lib/svtplay_dl/service/flowonline.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Flowonline(Service, OpenGraphThumbMixin):
def get(self):
match = re.search('iframe src="(/embed/[^"]+)"', self.get_urldata())
if not match:
yield ServiceError("Cant find video")
yield ServiceError("Can't find video")
return
parse = urlparse(self.url)

Expand All @@ -31,7 +31,7 @@ def get(self):

match = re.search('source src="([^"]+)" type="application/x-mpegURL"', data.text)
if not match:
yield ServiceError("Cant find video file")
yield ServiceError("Can't find video file")
return

yield from hlsparse(self.config, self.http.request("get", match.group(1)), match.group(1), output=self.output)
4 changes: 2 additions & 2 deletions lib/svtplay_dl/service/nhl.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class NHL(Service, OpenGraphThumbMixin):
def get(self):
match = re.search(r"var initialMedia\s+= ({[^;]+);", self.get_urldata())
if not match:
yield ServiceError("Cant find any media on that page")
yield ServiceError("Can't find any media on that page")
return
janson = json.loads(match.group(1))
vid = janson["content_id"]
Expand All @@ -29,7 +29,7 @@ def get(self):
else:
match = re.search(r"var mediaConfig\s+= ({[^;]+);", self.get_urldata())
if not match:
yield ServiceError("Cant find any media on that page")
yield ServiceError("Can't find any media on that page")
return
janson = json.loads(match.group(1))
try:
Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/oppetarkiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class OppetArkiv(Service, OpenGraphThumbMixin):
def get(self):
vid = self.find_video_id()
if vid is None:
yield ServiceError("Cant find video id for this video")
yield ServiceError("Can't find video id for this video")
return

url = f"http://api.svt.se/videoplayer-api/video/{vid}"
Expand Down
4 changes: 2 additions & 2 deletions lib/svtplay_dl/service/picsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ class Picsearch(Service, OpenGraphThumbMixin):
def get(self):
ajax_auth = self.get_auth()
if not ajax_auth:
yield ServiceError("Cant find token for video")
yield ServiceError("Can't find token for video")
return

mediaid = self.get_mediaid()
if not mediaid:
yield ServiceError("Cant find media id")
yield ServiceError("Can't find media id")
return
if not isinstance(mediaid, str):
mediaid = mediaid.group(1)
Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/pokemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def get(self):

match = re.search(r"id=([a-f0-9]+)\&", parse.fragment)
if not match:
yield ServiceError("Cant find the ID in the url")
yield ServiceError("Can't find the ID in the url")
return

match2 = re.search(r'region: "(\w+)"', self.get_urldata())
Expand Down
4 changes: 2 additions & 2 deletions lib/svtplay_dl/service/riksdagen.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Riksdagen(Service, OpenGraphThumbMixin):
def get(self):
match = re.search("_([a-zA-Z0-9]+)$", self.url)
if not match:
yield ServiceError("Cant find video id.")
yield ServiceError("Can't find video id.")
return

vid = match.group(1)
Expand All @@ -22,7 +22,7 @@ def get(self):
try:
janson = data["videodata"][0]["streams"]["files"]
except TypeError:
yield ServiceError("Cant find video.")
yield ServiceError("Can't find video.")
return

for i in janson:
Expand Down
6 changes: 3 additions & 3 deletions lib/svtplay_dl/service/sportlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ def get(self):
data = self.http.get(url).text
match = re.search('CLIENT_SECRET:"([^"]+)"', data)
if not match:
yield ServiceError("Cant fint login info")
yield ServiceError("Can't fint login info")
return
cs = match.group(1)
match = re.search('CLIENT_ID:"([^"]+)"', data)
if not match:
yield ServiceError("Cant fint login info")
yield ServiceError("Can't fint login info")
return

res = self.http.get("https://core.oz.com/channels?slug=sportlib&org=www.sportlib.se")
Expand All @@ -53,7 +53,7 @@ def get(self):
parse = urlparse(self.url)
match = re.search("video/([-a-fA-F0-9]+)", parse.path)
if not match:
yield ServiceError("Cant find video id")
yield ServiceError("Can't find video id")
return

url = f"https://core.oz.com/channels/{sid}/videos/{match.group(1)}?include=collection,streamUrl"
Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/svt.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get(self):
if not match:
match = re.search(r"stateData = JSON.parse\(\"(.*)\"\)\<\/script", data)
if not match:
yield ServiceError("Cant find video info.")
yield ServiceError("Can't find video info.")
return
janson = json.loads(codecs.escape_decode(match.group(1))[0].decode("utf-8"))
if janson["recipe"]["content"]["data"]["videoClips"]:
Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/svtplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def extrametadata(self, episode):
if "validFrom" in episode["item"]:

def _fix_broken_timezone_implementation(value):
# cx_freeze cant include .zip file for dateutil and < py37 have issues with timezones with : in it
# cx_freeze can't include .zip file for dateutil and < py37 have issues with timezones with : in it
if "+" in value and ":" == value[-3:-2]:
value = value[:-3] + value[-2:]
return value
Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
# The unittest framwork doesn't play nice with pylint:
# The unittest framework doesn't play nice with pylint:
# pylint: disable-msg=C0103


Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/tests/expressen.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
# The unittest framwork doesn't play nice with pylint:
# The unittest framework doesn't play nice with pylint:
# pylint: disable-msg=C0103
import unittest

Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/tests/oppetarkiv.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
# The unittest framwork doesn't play nice with pylint:
# The unittest framework doesn't play nice with pylint:
# pylint: disable-msg=C0103
import unittest

Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/tests/picsearch.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
# The unittest framwork doesn't play nice with pylint:
# The unittest framework doesn't play nice with pylint:
# pylint: disable-msg=C0103
import unittest

Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/tests/svtplay.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
# The unittest framwork doesn't play nice with pylint:
# The unittest framework doesn't play nice with pylint:
# pylint: disable-msg=C0103
import unittest

Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/tests/twitch.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
# The unittest framwork doesn't play nice with pylint:
# The unittest framework doesn't play nice with pylint:
# pylint: disable-msg=C0103
import unittest

Expand Down
4 changes: 2 additions & 2 deletions lib/svtplay_dl/service/tv4play.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get(self):

jansson = json.loads(match.group(1))
if "assetId" not in jansson["query"]:
yield ServiceError("Cant find video id for the video")
yield ServiceError("Can't find video id for the video")
return

vid = jansson["query"]["assetId"]
Expand All @@ -65,7 +65,7 @@ def get(self):
self.output["episodethumbnailurl"] = item["image"]

if vid is None:
yield ServiceError("Cant find video id for the video")
yield ServiceError("Can't find video id for the video")
return

url = f"https://playback2.a2d.tv/play/{vid}?service=tv4&device=browser&browser=GoogleChrome&protocol=hls%2Cdash&drm=widevine&capabilities=live-drm-adstitch-2%2Cexpired_assets"
Expand Down
6 changes: 3 additions & 3 deletions lib/svtplay_dl/service/viaplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get(self):

match = re.search('}}}},("staticPages".*}}); windo', self.get_urldata())
if not match:
yield ServiceError("Cant find necessary info")
yield ServiceError("Can't find necessary info")
return
janson = self._jansonpage(match.group(1))
video = None
Expand Down Expand Up @@ -121,7 +121,7 @@ def find_all_episodes(self, config):
data = self.get_urldata()
match = re.search('}}}},("staticPages".*}}); windo', data)
if not match:
logging.error("Cant find necessary info")
logging.error("Can't find necessary info")
return episodes

janson = self._jansonpage(match.group(1))
Expand All @@ -132,7 +132,7 @@ def find_all_episodes(self, config):
data = res.text
match = re.search('}}}},("staticPages".*}}); windo', data)
if not match:
logging.error("Cant find necessary info")
logging.error("Can't find necessary info")
return episodes

janson = self._jansonpage(match.group(1))
Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/service/viasatsport.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Viasatsport(Service, OpenGraphThumbMixin):
def get(self):
match = re.search("__STATE__']=({.*});</script><script>window", self.get_urldata())
if not match:
yield ServiceError("Cant find video info")
yield ServiceError("Can't find video info")
return

dataj = json.loads(match.group(1))
Expand Down
4 changes: 2 additions & 2 deletions lib/svtplay_dl/service/youplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def get(self):
data = self.get_urldata()
match = re.search(r'script async defer src="(//content.youplay.se[^"]+)"', data)
if not match:
yield ServiceError(f"Cant find video info for {self.url}")
yield ServiceError(f"Can't find video info for {self.url}")
return

data = self.http.request("get", f"http:{match.group(1)}".content)
Expand All @@ -29,7 +29,7 @@ def get(self):
data = unquote_plus(match.group(1))
match = re.search(r"videoData = ({[^;]+});", data)
if not match:
yield ServiceError(f"Cant find video info for {self.url}")
yield ServiceError(f"Can't find video info for {self.url}")
return
# fix broken json.
regex = re.compile(r"\s(\w+):")
Expand Down
2 changes: 1 addition & 1 deletion lib/svtplay_dl/subtitle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def timestr(msec):

HH:MM:SS,SS

with 10 millisecond precision. Note the , seperator in
with 10 millisecond precision. Note the , separator in
the seconds.
"""
sec = float(msec) / 1000
Expand Down
4 changes: 2 additions & 2 deletions lib/svtplay_dl/tests/test_hls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
# The unittest framwork doesn't play nice with pylint:
# The unittest framework doesn't play nice with pylint:
# pylint: disable-msg=C0103
# We're a test, we go where ever we want (within reason, of course):
# pylint: disable-msg=protected-access
Expand Down Expand Up @@ -32,7 +32,7 @@ def parse_m3u8(playlist):


# Example HLS playlist, source:
# loosly inspired by
# loosely inspired by
# https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8
M3U_EXAMPLE = """#EXTM3U

Expand Down
Loading