-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
442 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,10 +132,5 @@ dmypy.json | |
.vscode/ | ||
|
||
# Custom | ||
app.py | ||
app.*.py | ||
tst.py | ||
tst.*.py | ||
_.*.py | ||
_.*/ | ||
.ignore/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from innertube import InnerTube | ||
from innertube.raw_models import ResponseContext | ||
|
||
WEB = InnerTube("WEB", "2.20230728.00.00") | ||
WEB_REMIX = InnerTube("WEB_REMIX", "1.20220607.03.01") | ||
IOS = InnerTube("IOS", "17.14.2") | ||
IOS_MUSIC = InnerTube("IOS_MUSIC", "4.16.1") | ||
|
||
channel_id: str = "UC8Yu1_yfN5qPh601Y4btsYw" # Arctic Monkeys | ||
|
||
d = data = WEB_REMIX.adaptor.dispatch("browse", body={"browseId": channel_id}) | ||
|
||
rc = ResponseContext.parse_obj(data["responseContext"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from enum import Enum, auto | ||
|
||
|
||
class SharePanelType(Enum): | ||
SHARE_PANEL_TYPE_UNIFIED_SHARE_PANEL = auto() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import pydantic | ||
import humps | ||
from typing import Optional, Sequence | ||
|
||
from .raw_enums import SharePanelType | ||
|
||
|
||
class BaseModel(pydantic.BaseModel): | ||
class Config: | ||
alias_generator = humps.camelize | ||
|
||
|
||
class ServiceTrackingParam(BaseModel): | ||
key: str | ||
value: str | ||
|
||
|
||
class ServiceTrackingParams(BaseModel): | ||
service: str | ||
params: Sequence[ServiceTrackingParam] | ||
|
||
|
||
class MainAppWebResponseContext(BaseModel): | ||
logged_out: bool | ||
tracking_param: str | ||
|
||
|
||
class WebResponseContextExtensionData(BaseModel): | ||
has_decorated: bool | ||
|
||
|
||
class ResponseContext(BaseModel): | ||
visitor_data: str | ||
service_tracking_params: Sequence[ServiceTrackingParams] | ||
max_age_seconds: int | ||
main_app_web_response_context: Optional[MainAppWebResponseContext] = None | ||
web_response_context_extension_data: Optional[ | ||
WebResponseContextExtensionData | ||
] = None | ||
|
||
|
||
class Response(BaseModel): | ||
response_context: ResponseContext | ||
|
||
|
||
class ShareEntityEndpoint(BaseModel): | ||
serialized_share_entity: str | ||
share_panel_type: SharePanelType |
Oops, something went wrong.