mirror of
https://github.com/ihabunek/twitch-dl
synced 2024-08-30 18:32:25 +00:00
Expand tests
This commit is contained in:
parent
cacf921923
commit
8e3a41e415
@ -2,7 +2,10 @@
|
|||||||
These tests depend on the channel having some videos and clips published.
|
These tests depend on the channel having some videos and clips published.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
import m3u8
|
||||||
from twitchdl import twitch
|
from twitchdl import twitch
|
||||||
|
from twitchdl.commands.download import _parse_playlists
|
||||||
|
|
||||||
TEST_CHANNEL = "bananasaurus_rex"
|
TEST_CHANNEL = "bananasaurus_rex"
|
||||||
|
|
||||||
@ -16,6 +19,21 @@ def test_get_videos():
|
|||||||
video = twitch.get_video(video_id)
|
video = twitch.get_video(video_id)
|
||||||
assert video["id"] == video_id
|
assert video["id"] == video_id
|
||||||
|
|
||||||
|
access_token = twitch.get_access_token(video_id)
|
||||||
|
assert "signature" in access_token
|
||||||
|
assert "value" in access_token
|
||||||
|
|
||||||
|
playlists = twitch.get_playlists(video_id, access_token)
|
||||||
|
assert playlists.startswith("#EXTM3U")
|
||||||
|
|
||||||
|
name, res, url = next(_parse_playlists(playlists))
|
||||||
|
playlist = httpx.get(url).text
|
||||||
|
assert playlist.startswith("#EXTM3U")
|
||||||
|
|
||||||
|
playlist = m3u8.loads(playlist)
|
||||||
|
vod_path = playlist.segments[0].uri
|
||||||
|
assert vod_path == "0.ts"
|
||||||
|
|
||||||
|
|
||||||
def test_get_clips():
|
def test_get_clips():
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user