Skip to content

Commit 1c4a3c2

Browse files
committed
Type fixes
1 parent 5115320 commit 1c4a3c2

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "youtube-up"
3-
version = "0.5.5"
3+
version = "0.5.6"
44
description = "Upload videos to YouTube using the internal YouTube API. Does not require an API key."
55
authors = ["7x11x13 <x7x11x13@gmail.com>"]
66
readme = "README.md"

youtube_up/uploader.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import base64
24
import copy
35
import json
@@ -9,7 +11,7 @@
911
from dataclasses import dataclass
1012
from hashlib import sha1
1113
from http.cookiejar import Cookie, FileCookieJar, MozillaCookieJar
12-
from typing import Callable, Dict, Optional
14+
from typing import Callable, Optional
1315

1416
import requests
1517
from selenium.webdriver.chrome.service import Service as ChromeService
@@ -395,7 +397,7 @@ def _get_upload_url_thumbnail(self, data: YTUploaderVideoData) -> str:
395397
"https://upload.youtube.com/upload/studiothumbnail", data.authuser, {}
396398
)
397399

398-
def _get_creator_playlists(self, data: YTUploaderVideoData) -> Dict[str, str]:
400+
def _get_creator_playlists(self, data: YTUploaderVideoData) -> dict[str, str]:
399401
playlists = {}
400402
page_token = ""
401403
while True:
@@ -425,7 +427,7 @@ def _get_creator_playlists(self, data: YTUploaderVideoData) -> Dict[str, str]:
425427
break
426428
return playlists
427429

428-
def _get_claimed_videos(self, data: YTUploaderVideoData) -> Dict[str, str]:
430+
def _get_claimed_videos(self, data: YTUploaderVideoData) -> list[dict]:
429431
videos = []
430432
page_token = ""
431433
while True:
@@ -462,8 +464,8 @@ def _get_claim_info(self, data: YTUploaderVideoData, video_id: str):
462464
json=data,
463465
)
464466
r.raise_for_status()
465-
data = r.json()
466-
return list(zip(data["receivedClaims"], data["contentOwners"]))
467+
json = r.json()
468+
return list(zip(json["receivedClaims"], json["contentOwners"]))
467469

468470
def _dispute_claim(
469471
self,

0 commit comments

Comments
 (0)