diff --git a/src/app.rs b/src/app.rs index 01f1435..8485314 100644 --- a/src/app.rs +++ b/src/app.rs @@ -97,7 +97,7 @@ impl eframe::App for App { } }); - if self.tor_connected { + // if self.tor_connected { egui::TopBottomPanel::bottom("radio_player").show(ctx, |ui| { ui.heading(egui::RichText::new("WOW!Radio").color(egui::Color32::GREEN)); ui.label(egui::RichText::new("Your home for the most diabolical playlist of the century, \nmade by the skeevers, scallywags, chupacabras, and whores\n of the Wownero community. Join da chat to peep da scoop.\n").color(egui::Color32::GREEN)); @@ -134,8 +134,8 @@ impl eframe::App for App { ui.label("\n"); } }); - } else { + // } else { // - } + // } } } \ No newline at end of file diff --git a/src/player.rs b/src/player.rs index cff050d..0dd8345 100644 --- a/src/player.rs +++ b/src/player.rs @@ -16,7 +16,7 @@ impl Player { sink, stream_handle, stream_thread: std::thread::spawn(|| {}), - stream_source: "http://wowradiod6mhb4ignjqy5ghf5l42yh2yeumgeq3yi7gn7yqy3efhe5ad.onion".to_owned(), + stream_source: "https://radio.wownero.com/wow.ogg".to_owned(), stream_exif: "".to_owned(), volume: 100.0, playing: false @@ -30,31 +30,20 @@ impl Player { } pub fn check_radio_stream(&self) -> bool { - let url = format!("{}/wow.ogg", self.stream_source); - let res = reqwest::blocking::Client::builder() - .proxy(reqwest::Proxy::http("socks5://127.0.0.1:19050").unwrap()) - .build() - .unwrap() - .get(url) - .send(); - match res { - Ok(r) => r.status().is_success(), - Err(_e) => false + let res: reqwest::blocking::Response = reqwest::blocking::get(self.stream_source.clone()).expect("request failed"); + if res.status().is_success() { + true + } else { + false } } pub fn start_radio_stream(&self) -> std::thread::JoinHandle<()> { - let url = format!("{}/wow.ogg", self.stream_source); + let url = self.stream_source.clone(); let t: Result, std::io::Error> = std::thread::Builder::new().name("radio_stream".to_string()).spawn(move || { - let res: Result = reqwest::blocking::Client::builder() - .proxy(reqwest::Proxy::http("socks5://127.0.0.1:19050").unwrap()) - .timeout(std::time::Duration::from_secs(15)) - .build() - .unwrap() - .get(url) - .send(); + let mut res: reqwest::blocking::Response = reqwest::blocking::get(url).expect("request failed"); let mut out: std::fs::File = std::fs::File::create(&crate::RADIO_STREAM).expect("failed to create file"); - std::io::copy(&mut res.unwrap(), &mut out).expect("failed to copy content"); + std::io::copy(&mut res, &mut out).expect("failed to copy content"); }); return t.unwrap() }