Schroedinger-Hat / youtube-to-anchorfm

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

youtube-to-anchorfm not working when language is not English #95

Closed matevskial closed 1 year ago

matevskial commented 1 year ago

Issues or necessity of a feature youtube-to-anchorfm not working when language is not English

weltonrodrigo commented 1 year ago

I've used this to force the language in the old anchor ui, maybe it still works:

diff --git a/src/anchorfm-pupeteer/index.js b/src/anchorfm-pupeteer/index.js
index a3de1d1..0726476 100644
--- a/src/anchorfm-pupeteer/index.js
+++ b/src/anchorfm-pupeteer/index.js
@@ -78,6 +78,9 @@ async function postEpisode(youtubeVideoInfo) {
     browser = await puppeteer.launch({ args: ['--no-sandbox'], headless: env.PUPETEER_HEADLESS });
     const page = await browser.newPage();

+    // Force english
+    await page.setExtraHTTPHeaders({ 'Accept-Language': 'en' });
+
     const navigationPromise = page.waitForNavigation();

     await page.goto('https://podcasters.spotify.com/pod/dashboard/episode/new');
matevskial commented 1 year ago

Thanks for your input.

I already made a PR for setting the language to English