-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
use std::env::args; | ||
use std::{env::args, future::IntoFuture}; | ||
|
||
use brainrot::youtube; | ||
use futures_util::StreamExt; | ||
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (ubuntu-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (ubuntu-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (ubuntu-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (windows-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (windows-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (windows-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (ubuntu-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (ubuntu-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (ubuntu-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (macos-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (macos-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (macos-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (windows-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (windows-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (windows-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (macos-latest, stable)
Check warning on line 4 in examples/youtube.rs GitHub Actions / Build and test (macos-latest, stable)
|
||
|
||
#[tokio::main] | ||
async fn main() -> anyhow::Result<()> { | ||
let (options, cont) = youtube::get_options_from_live_page("5Z5Sys8-tLs").await?; | ||
let (options, cont) = youtube::get_options_from_live_page("6DcXroWNDvk").await?; | ||
let initial_chat = youtube::fetch_yt_chat_page(&options, cont).await?; | ||
youtube::subscribe_to_events(&options, &initial_chat).await?; | ||
let subscriber = youtube::SignalerChannel::new_from_cont(&initial_chat).await?; | ||
let (receiver, handle) = subscriber.spawn_event_subscriber().await?; | ||
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (ubuntu-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (ubuntu-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (ubuntu-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (windows-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (windows-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (windows-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (ubuntu-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (ubuntu-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (ubuntu-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (macos-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (macos-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (macos-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (windows-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (windows-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (windows-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (macos-latest, stable)
Check warning on line 11 in examples/youtube.rs GitHub Actions / Build and test (macos-latest, stable)
|
||
handle.into_future().await.unwrap(); | ||
Ok(()) | ||
} |