Schroedinger-Hat / youtube-to-anchorfm

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

"Publish now" button changed to <div> #30

Closed abe-101 closed 2 years ago

abe-101 commented 2 years ago

Currently this github action is only able to create a draft. When trying to publish it exits with an error. After digging through the source code at anchor.fm it became apparent that the "Publish now" button is under a <div> tag, whereas the "Save as draft" is under a <button> tag. That explain why the code only works for a draft: https://github.com/Schrodinger-Hat/youtube-to-anchorfm/blob/b5bff4d2790d82a1b548283492cde0a00a1a4653/index.js#L119

on the other hand when i changed the code to:

 const [button] = await page.$x(`//div[text()="${actionText}"]`); 

it only works for the "Publish now" button and not the "Save as draft" button.

abe-101 commented 2 years ago

The solution is as simple as creating boolean condition.

I can make a pull request after the weakend.

abe-101 commented 2 years ago

I'm attaching a picture of the code at anchor.fm

div-botton

abe-101 commented 2 years ago

The solution is as simple as creating boolean condition.

I can make a pull request after the weakend.

@matevskial Has already addressed this issue

davideimola commented 2 years ago

Hi @matevskial. Can you comment on this issue so I can assign it to you?

abe-101 commented 2 years ago

For reference, commit https://github.com/Schrodinger-Hat/youtube-to-anchorfm/pull/31/commits/7f739ed080325ceba6d1823e2285b46ccec3e961 addresses the issue

matevskial commented 2 years ago

My PR #31 indeed addresses the issue.