Schroedinger-Hat / youtube-to-anchorfm

An automation process to convert YouTube video into audio file and uploading it to Anchor.fm podcast
MIT License
127 stars 70 forks source link

TimeoutError: Waiting for selector `#title` failed: Waiting failed: 30000ms exceeded #99

Closed AnimeshKumar923 closed 10 months ago

AnimeshKumar923 commented 11 months ago

Issues or necessity of a feature

I was adopting the workflow in developing this feature under AsyncAPI's community repository. While the workflow was running fine 3 weeks, it started showing the following issue. The workflow has workflow_dispatch event trigger being implemented.

Step to reproduce the bug / needs of a new feature

Steps to reproduce the behavior:

  1. Run the workflow through a workflow_dispatch event.

Screenshots

image

Error log

See y'all in Paris!!
Upload date: {"year":"2023","month":"Oct","day":"03"}
Downloading thumbnail for video id ebHCd79w2Ws
Downloading audio for video id ebHCd79w2Ws
Downloaded thumbnail for video id ebHCd79w2Ws
Downloaded audio for video id ebHCd79w2Ws
Posting episode to anchorfm
Launching puppeteer
Setting language to English
Accessing Log in with email
Trying to log in
Logged in
Uploading audio file
Waiting for upload to finish
-- Adding title
Error: Unable to post episode to anchorfm: TimeoutError: Waiting for selector `#title` failed: Waiting failed: 30000ms exceeded
    at postEpisode (/src/anchorfm-pupeteer/index.js:178:11)
    at async main (/src/index.js:36:3)
TheJoin95 commented 11 months ago

Thanks for reporting this, I know this could be an intermittent issue as well as a long issue as it was for #87

Any more infos to debug it would be great as well as any contributions :) We are now trying to organizing our next conference (https://github.com/Schrodinger-Hat/osday/) and it's very time consuming that we might not be able to fix the issue.

I'm assigning this to @matevskial and @abe-101

AnimeshKumar923 commented 11 months ago

@TheJoin95

Hey there! :wave: @derberg is one of the maintainers of the repository and I'm developing that workflow under his mentorship.

He suggested the following changes:

maybe https://github.com/Schrodinger-Hat/youtube-to-anchorfm/blob/342a55c7f1d72e18dc2d2f0af36edc13bd615667/src/anchorfm-pupeteer/index.js#L165C4-L166C29 is giving timeout, as probably the videos are to big and it just takes time.

maybe open PR to their action to change

await clickXpath(
  page,
  saveDraftOrPublishOrScheduleButtonDescription.xpath
);

to

await clickXpath(
  page,
  saveDraftOrPublishOrScheduleButtonDescription.xpath,
  {timeout: env.UPLOAD_TIMEOUT}
);

this will enable us to pass a custom much larger timeout through env variable. They already allow it with https://github.com/Schrodinger-Hat/youtube-to-anchorfm/blob/342a55c7f1d72e18dc2d2f0af36edc13bd615667/src/anchorfm-pupeteer/index.js#L123C5-L126C29 so I bet they will agree with your PR suggestion

How does this suggestion sounds? :eyes:

We are now trying to organizing our next conference (https://github.com/Schrodinger-Hat/osday/) and it's very time consuming that we might not be able to fix the issue.

Oh, didn't knew that, no worries. Yes, it's difficult to give time on this issue when your hands are already full. Anyways, all the best for the conference :+1: :100:

cc: @matevskial @abe-101, I'm not well-versed in JavaScript as such so I can't contribute much to the code, but do let me know if there's any other things to help with. :+1:

matevskial commented 11 months ago

@AnimeshKumar923

Hello and thanks for reporting the issue.

I am also using youtube-to-anchorfm personally at least 3 times a week and I have good news!

I am also able to reproduce the exact problem you have. So it also doesn't work for me :)

And I'll make the effort to fix this issue.

matevskial commented 11 months ago

I investigated a bit, and it seems podcasters for spotify(or anchor.fm) changed the flow for uploading episodes a bit.

I am going to rework the script.

TheJoin95 commented 11 months ago

Thanks @matevskial to handle this!

matevskial commented 10 months ago

I made the PR.

Now the script should work most of the time.

AnimeshKumar923 commented 10 months ago

I made the PR.

Now the script should work most of the time.

Let me check it...

AnimeshKumar923 commented 10 months ago

@matevskial

Just ran the workflow 2 times. Both were published successfully. 👍 🚀

AnimeshKumar923 commented 10 months ago

@matevskial

Another warning I saw while the workflow was building was of Script deprecation warning. Thought about sharing it.

deprecation-warning

matevskial commented 10 months ago

Thanks for the information. I am closing this issue.

AnimeshKumar923 commented 10 months ago

Thank you very much for solving the issue. :rocket: @matevskial