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);
|
eprintln!("Failed to get video data: {:?}", err);
|
||||||
waited = true;
|
waited = true;
|
||||||
if let structs::Error::YoutubeDL(ref err) = err {
|
if let structs::Error::YoutubeDL(ref err) = err {
|
||||||
if err.output.contains("429")
|
let output = err.output.to_lowercase();
|
||||||
|| err
|
if output.contains("429")
|
||||||
.output
|
|| output.contains("too many request")
|
||||||
.to_lowercase()
|
|| output.contains("technical difficult")
|
||||||
.contains("too many request")
|
|
||||||
{
|
{
|
||||||
sleep(Duration::from_secs(i * 60 * 60)).await;
|
sleep(Duration::from_secs(i * 60 * 60)).await;
|
||||||
i += 1;
|
i += 1;
|
||||||
|
|
|
@ -170,8 +170,10 @@ pub async fn get_video_retry(
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
eprintln!("Failed to get video data: {:?}", err);
|
eprintln!("Failed to get video data: {:?}", err);
|
||||||
if let Error::YoutubeDL(ref err) = err {
|
if let Error::YoutubeDL(ref err) = err {
|
||||||
if err.output.contains("429")
|
let output = err.output.to_lowercase();
|
||||||
|| err.output.to_lowercase().contains("too many requests")
|
if output.contains("429")
|
||||||
|
|| output.contains("too many requests")
|
||||||
|
|| output.contains("technical difficult")
|
||||||
{
|
{
|
||||||
sleep(Duration::from_secs(i * 60 * 60)).await;
|
sleep(Duration::from_secs(i * 60 * 60)).await;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue