mirror of
https://github.com/ihabunek/twitch-dl
synced 2024-08-30 18:32:25 +00:00
Fix tuple typing to work on py 3.8
This commit is contained in:
parent
d777f0e98a
commit
6ed98fa4ef
@ -2,7 +2,7 @@ import logging
|
|||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from typing import Optional
|
from typing import Optional, Tuple
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
@ -255,7 +255,7 @@ def clips(
|
|||||||
default=5,
|
default=5,
|
||||||
)
|
)
|
||||||
def download(
|
def download(
|
||||||
ids: tuple[str, ...],
|
ids: Tuple[str, ...],
|
||||||
auth_token: Optional[str],
|
auth_token: Optional[str],
|
||||||
chapter: Optional[int],
|
chapter: Optional[int],
|
||||||
concat: bool,
|
concat: bool,
|
||||||
@ -374,7 +374,7 @@ def videos(
|
|||||||
channel_name: str,
|
channel_name: str,
|
||||||
all: bool,
|
all: bool,
|
||||||
compact: bool,
|
compact: bool,
|
||||||
games_tuple: tuple[str, ...],
|
games_tuple: Tuple[str, ...],
|
||||||
json: bool,
|
json: bool,
|
||||||
limit: Optional[int],
|
limit: Optional[int],
|
||||||
pager: Optional[int],
|
pager: Optional[int],
|
||||||
|
@ -72,7 +72,7 @@ def video_info(video: Video, playlists, chapters: List[Chapter]):
|
|||||||
print_table(["Placeholder", "Value"], placeholders)
|
print_table(["Placeholder", "Value"], placeholders)
|
||||||
|
|
||||||
|
|
||||||
def video_json(video, playlists, chapters):
|
def video_json(video: Video, playlists: str, chapters: List[Chapter]):
|
||||||
playlists = m3u8.loads(playlists).playlists
|
playlists = m3u8.loads(playlists).playlists
|
||||||
|
|
||||||
video["playlists"] = [
|
video["playlists"] = [
|
||||||
|
@ -3,7 +3,7 @@ Twitch API access.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from typing import Dict, Generator, List, Literal, Mapping, Optional, TypedDict
|
from typing import Dict, Generator, List, Literal, Mapping, Optional, Tuple, TypedDict
|
||||||
|
|
||||||
import click
|
import click
|
||||||
import httpx
|
import httpx
|
||||||
@ -345,7 +345,7 @@ def channel_videos_generator(
|
|||||||
sort: VideosSort,
|
sort: VideosSort,
|
||||||
type: VideosType,
|
type: VideosType,
|
||||||
game_ids: Optional[List[str]] = None,
|
game_ids: Optional[List[str]] = None,
|
||||||
) -> tuple[int, Generator[Video, None, None]]:
|
) -> Tuple[int, Generator[Video, None, None]]:
|
||||||
game_ids = game_ids or []
|
game_ids = game_ids or []
|
||||||
|
|
||||||
def _generator(videos: Data, max_videos: int) -> Generator[Video, None, None]:
|
def _generator(videos: Data, max_videos: int) -> Generator[Video, None, None]:
|
||||||
|
Loading…
Reference in New Issue
Block a user