Skip to content

Commit

Permalink
Merge branch 'iv-org:master' into webserver
Browse files Browse the repository at this point in the history
  • Loading branch information
15532th authored Sep 17, 2024
2 parents 1c3e7e4 + b4b4cb7 commit 943a5bf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions index.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ async def main():
tab.add_handler(cdp.network.RequestWillBeSent, send_handler)
page = await browser.get('https://www.youtube.com/embed/jNQXAC9IVRw')
await tab.wait(cdp.network.RequestWillBeSent)
print("[INFO] waiting 10 seconds for the page to fully load.")
await tab.sleep(10)
button_play = await tab.select("#movie_player")
await button_play.click()
await tab.wait(cdp.network.RequestWillBeSent)
Expand All @@ -21,8 +23,12 @@ async def send_handler(event: cdp.network.RequestWillBeSent):
if "/youtubei/v1/player" in event.request.url:
post_data = event.request.post_data
post_data_json = json.loads(post_data)
print("visitor_data: " + post_data_json["context"]["client"]["visitorData"])
print("po_token: " + post_data_json["serviceIntegrityDimensions"]["poToken"])
visitor_data = post_data_json["context"]["client"]["visitorData"]
po_token = post_data_json["serviceIntegrityDimensions"]["poToken"]
print("visitor_data: " + visitor_data)
print("po_token: " + po_token)
if len(po_token) < 160:
print("[WARNING] there is a high chance that the potoken generated won't work. please try again on another internet connection.")
sys.exit(0)
return

Expand Down

0 comments on commit 943a5bf

Please sign in to comment.