forked from Seneral/FlagPlayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotes.txt
80 lines (67 loc) · 4.4 KB
/
Notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
PLANS:
-----
- Implement MSE (Media Source Extension) for synced, smooth playback of high-bandwidth and long videos - instead of current, crappy sync hax
- Statistically find lyrics in comments / description
- Different Layouts (Music-focussed with playlist, lyrics, etc. and Video-focussed)
- Subtitles support (custom)
BROWSING MECHANISM:
-------------------
- First page load gives csn (client-screen-nonce)
- Loading subsequent pages with csn set gives access to raw, small JSON
1. Get URL as youtube.com$URL
2. Get URL Hash:
for (var hash = 0, c = 0; c < URL.length; ++c)
hash = 31 * hash + URL.charCodeAt(c) >>> 0;
3. Set cookie 'ST-$hash' to session-data 'itct=...&csn=...'
4. Download URL with cookie as JSON
5. Response automatically deletes cookie
6. Set csn to new csn contained in response JSON
- IDEA: Get pages always as JSON with csn
- ALWAYS get csn first from small page
- /feed/history or /feed/library are smallest with just over 200kb
- DONT DO - session data is actually pretty stupid to get, itct is specific for every link in a page - which means, it only works visiting pages that are referenced in the current page - also, there's other stuff involved for some other pages (most notably search). Don't bother for that bit of extra data transferred
IMPORTANT KEYS:
---------------
ID_TOKEN (some youtube player id, looks important and is set as request headers, but can be omitted)
VISITOR_DATA (no idea but it's a key - maybe, a key to success?)
XSRF_TOKEN (required in request body as session_token=XSRF_TOKEN
INNERTUBE_CONTEXT_CLIENT_NAME (required in request headers as x-youtube-client-name)
INNERTUBE_CONTEXT_CLIENT_VERSION (required in request headers as x-youtube-client-version)
INNERTUBE_API_KEY (used a lot in tracking requests)
EI (playbackTracking ID, used for some stats and some content fetches - stored elsewhere in page)
SUSPECTED LIST OF AJAX COMMANDS:
--------------------------------
list_ajax (excluding style=json/style=xml)
GET /list_ajax?action_get_list=1 &list= &index= WORKS
GET /list_ajax?action_get_user_uploads_by_user=1 &username= WORKS - NEEDS USER, NOT CHANNEL!!
unsure what the general way to find it is
GET /list_ajax?action_get_templist=1 &video_ids=,,,, NOT GOTTEN TO WORK
search_ajax (excluding style=json/style=xml)
GET /search_ajax?embeddable=1 &search_query= &index= WORKS
comment_service_ajax (needs parameters ctoken, continuation and itct plus xsrf-token as session data in body)
POST /comment_service_ajax?action_get_video_preview=1 &video_id=
POST /comment_service_ajax?action_get_comment_replies=1 &pbj=1 WORKS
POST /comment_service_ajax?action_get_comments=1 &pbj=1 WORKS
channels_profile_ajax (NOT TESTED / NOT INTERESTED)
GET ? /channels_profile_ajax?action_get_business_email_captcha=1
POST /channels_profile_ajax?action_update_banner_image=1 postParams:b WITH b.crop_top=a.top,b.crop_right=a.right,b.crop_bottom=a.bottom,b.crop_left=a.left AND is_gallery_image:"ytbanner"==b
notifications_ajax (BODY very complex set of parameters)
POST /notifications_ajax?action_get_registration_token=1 WITH CREDENTIALS
POST /notifications_ajax?action_register_device=1 WITH BODY AND CREDENTIALS
POST /notifications_ajax?action_convert_endpoint_to_url=1 WITH BODY AND CREDENTIALS
POST /notifications_ajax?action_notification_click=1 WITH BODY AND CREDENTIALS
POST /notifications_ajax?action_get_notifications=1 WITH BODY AND CREDENTIALS
- Can be substituted by own notification system: channels supply RSS feed
playlist_video_ajax (NOT TESTED)
POST playlist_video_ajax?action_"+a+"=1"
WITH feature - authuser - pageId - add_to_playlists - plid=(PlaybackID)
WITH video_ids - source_playlist_id - full_list_id - delete_from_playlists - add_to_playlists - plid=(PlaybackID)
MAYBE: playlist_video_ajax?action_delete_from_playlist=1 &video_ids=,,, &source_playlist_id=
subscription_ajax (Alternative /subscription_service or smth?)
POST /subscription_ajax?action_update_subscription_preferences=1 &channel_id= &receive_all_updates=
guide_ajax (Loads the lefthandside bar with channels/playlists etc. when logged in)
GET /guide_ajax?action_load_guide=1
EXTRA
- CreateListCommand: /service_ajax
onCreateListCommand:{commandMetadata:{webCommandMetadata:{url:"/service_ajax",sendPost:!0}},createPlaylistServiceEndpoint:{videoIds:[],hack:!0,params:"CAQ%3D"}};
- /live_chat_push_config_ajax