Thanks to visit codestin.com
Credit goes to github.com

Skip to content

webbrowser.cdp: implement CDP connection#5388

Merged
bastimeyer merged 2 commits into
streamlink:masterfrom
bastimeyer:webbrowser/cdp/init
Jul 3, 2023
Merged

webbrowser.cdp: implement CDP connection#5388
bastimeyer merged 2 commits into
streamlink:masterfrom
bastimeyer:webbrowser/cdp/init

Conversation

@bastimeyer

@bastimeyer bastimeyer commented Jun 19, 2023

Copy link
Copy Markdown
Member

Part 3/4 of #5380

This currently includes the commits of #5381 (part 1) and #5386 (part 2), because this code is needed for the CDP connection stuff. Once those PRs have been merged into master, I will rebase this branch.

So the only relevant commits of this PR are the ones after the merge commit. See the check marks of the HEAD commits of those other branches.


This

  1. Adds the trio-websocket and typing-extensions runtime dependencies.
    • A bit unfortunate that we have to add another dependency for websockets, but it is what it is... Async I/O via trio is a requirement for a proper implementation.
    • typing-extensions is required, because I needed TypeAlias for making the CDPEventListener's typing work. This conveniently also adds Self and other things.
  2. Implements the CDP connection and session management.
    • As mentioned in Implement data extraction via web browser (Chrome devtools protocol) #5380, the basic design is borrowed from the trio-chrome-devtools-protocol project, which uses the MIT license. This is properly annotated with the included license text. I applied several improvements and fixes to the code. This is all fully tested with full coverage.
    • Trio 0.22 currently requires the from __future__ import annotations workaround so the memory channels can have proper typing information, which is important. This will be resolved in their next release (they are waiting for the EOL of py37), but I don't think it's worth removing the import and bumping the version requirement once it's released.

@bastimeyer

Copy link
Copy Markdown
Member Author

Rebased to current head of master, because this PR is the base branch for other PRs until it got merged into master.

@bastimeyer bastimeyer force-pushed the webbrowser/cdp/init branch 4 times, most recently from 1994d2f to 441c04d Compare June 29, 2023 00:41
@bastimeyer bastimeyer force-pushed the webbrowser/cdp/init branch from 441c04d to d22aa93 Compare July 3, 2023 16:05
@bastimeyer bastimeyer marked this pull request as ready for review July 3, 2023 16:05
@bastimeyer

Copy link
Copy Markdown
Member Author

Rebased to master (unrelated commits are now gone from the branch), added missing docs notes of the trio-websocket and typing-extensions dependencies, and removed backported import of AsyncMock (py37)

@bastimeyer bastimeyer merged commit 20c8b6b into streamlink:master Jul 3, 2023
@bastimeyer bastimeyer deleted the webbrowser/cdp/init branch July 3, 2023 16:15
snorkelopstesting2-coder pushed a commit to snorkel-marlin-repos/streamlink_streamlink_pr_5388_591e97a6-acb4-41e9-bb1b-4cea41c8f528 that referenced this pull request Oct 22, 2025
Original PR #5388 by bastimeyer
Original: streamlink/streamlink#5388
snorkelopstesting4-web added a commit to snorkel-marlin-repos/streamlink_streamlink_pr_5388_591e97a6-acb4-41e9-bb1b-4cea41c8f528 that referenced this pull request Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant