feat: log failed player fetch attempts with player_from_clients
This commit is contained in:
parent
f0d5e9f195
commit
2ce96b14de
1 changed files with 5 additions and 1 deletions
|
|
@ -104,8 +104,9 @@ impl RustyPipeQuery {
|
||||||
) -> Result<VideoPlayer, Error> {
|
) -> Result<VideoPlayer, Error> {
|
||||||
let video_id = video_id.as_ref();
|
let video_id = video_id.as_ref();
|
||||||
let mut last_e = None;
|
let mut last_e = None;
|
||||||
|
let mut clients_iter = clients.iter().peekable();
|
||||||
|
|
||||||
for client in clients {
|
while let Some(client) = clients_iter.next() {
|
||||||
if self.opts.auth == Some(true) && !self.auth_enabled(*client) {
|
if self.opts.auth == Some(true) && !self.auth_enabled(*client) {
|
||||||
// If no client has auth enabled, return NoLogin error instead of "no clients"
|
// If no client has auth enabled, return NoLogin error instead of "no clients"
|
||||||
if last_e.is_none() {
|
if last_e.is_none() {
|
||||||
|
|
@ -142,6 +143,9 @@ impl RustyPipeQuery {
|
||||||
} else if !e.switch_client() {
|
} else if !e.switch_client() {
|
||||||
return Err(Error::Extraction(e));
|
return Err(Error::Extraction(e));
|
||||||
}
|
}
|
||||||
|
if let Some(next_client) = clients_iter.peek() {
|
||||||
|
tracing::warn!("error fetching player with {client:?} client: {e}; retrying with {next_client:?} client");
|
||||||
|
}
|
||||||
last_e = Some(Error::Extraction(e));
|
last_e = Some(Error::Extraction(e));
|
||||||
}
|
}
|
||||||
Err(e) => return Err(e),
|
Err(e) => return Err(e),
|
||||||
|
|
|
||||||
Reference in a new issue