diff options
author | Pawky Languish | 2025-04-19 19:07:38 +0000 |
---|---|---|
committer | Pawky Languish | 2025-04-19 19:07:38 +0000 |
commit | f4fb34dde6b03fdb49f71476d587c5c7f986b565 (patch) | |
tree | ef8cc174c413dcd766754bc51c52b9a2fc328e5c /_.txt | |
parent | 12062621d6d67adb8abee962f4201e2d5196f55b (diff) |
Diffstat (limited to '_.txt')
-rw-r--r-- | _.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/_.txt b/_.txt new file mode 100644 index 0000000..6737b50 --- /dev/null +++ b/_.txt @@ -0,0 +1,19 @@ +import urllib.request, json + +req = urllib.request.Request("https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8") +req.add_header("Content-Type", "application/json") +j = json.loads( + urllib.request.urlopen( + req, + b'{"context":{"client":{"clientName":"TVHTML5_SIMPLY_EMBEDDED_PLAYER","clientVersion":"2.0"},"thirdParty":{"embedUrl":"https://www.youtube.com"}},"videoId": "VpGjqueO0b4"}', + ) + .read() + .decode() +) +j = j["videoDetails"] +print( + f'{j["title"]} ({j["lengthSeconds"]} sec), uploaded by {j["author"]}, {j["viewCount"]} views', + j["isCrawlable"], + j["isUnpluggedCorpus"], + j["isLiveContent"], +) |