fast72 commited on
Commit
148bb44
·
verified ·
1 Parent(s): 3c8c65c

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +3 -1
server.js CHANGED
@@ -10,7 +10,9 @@ const PORT = 7860;
10
  async function transcript(url) {
11
  const response = await axios.post( 'https://youtubetotranscript.com/transcript', new URLSearchParams({ youtube_url: url }), { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } } );
12
  const html = response.data;
13
- const $ = cheerio.load(html); const texts = $('.transcript-segment').map((i, el) => $(el).text().trim()).get();
 
 
14
  };
15
 
16
  app.get('/transcript', async (req, res) => {
 
10
  async function transcript(url) {
11
  const response = await axios.post( 'https://youtubetotranscript.com/transcript', new URLSearchParams({ youtube_url: url }), { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } } );
12
  const html = response.data;
13
+ const $ = cheerio.load(html);
14
+ const texts = $('.transcript-segment').map((i, el) => $(el).text().trim()).get();
15
+ return texts;
16
  };
17
 
18
  app.get('/transcript', async (req, res) => {