Handle "technical difficulties"
This commit is contained in:
parent
2524833326
commit
e6b44d8dbf
|
@ -195,11 +195,10 @@ async fn async_main() {
|
|||
eprintln!("Failed to get video data: {:?}", err);
|
||||
waited = true;
|
||||
if let structs::Error::YoutubeDL(ref err) = err {
|
||||
if err.output.contains("429")
|
||||
|| err
|
||||
.output
|
||||
.to_lowercase()
|
||||
.contains("too many request")
|
||||
let output = err.output.to_lowercase();
|
||||
if output.contains("429")
|
||||
|| output.contains("too many request")
|
||||
|| output.contains("technical difficult")
|
||||
{
|
||||
sleep(Duration::from_secs(i * 60 * 60)).await;
|
||||
i += 1;
|
||||
|
|
|
@ -170,8 +170,10 @@ pub async fn get_video_retry(
|
|||
Err(err) => {
|
||||
eprintln!("Failed to get video data: {:?}", err);
|
||||
if let Error::YoutubeDL(ref err) = err {
|
||||
if err.output.contains("429")
|
||||
|| err.output.to_lowercase().contains("too many requests")
|
||||
let output = err.output.to_lowercase();
|
||||
if output.contains("429")
|
||||
|| output.contains("too many requests")
|
||||
|| output.contains("technical difficult")
|
||||
{
|
||||
sleep(Duration::from_secs(i * 60 * 60)).await;
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue