Sweetdevil144 / Youtube-Shorts-Creator

A Website that helps extract shorts segments from a youtube video link
https://youtube-shorts-creator.onrender.com
10 stars 7 forks source link

Captions is not iterable #7

Open akeslo opened 9 months ago

akeslo commented 9 months ago
image
Sweetdevil144 commented 9 months ago

Lemme take a look into it !!

Sweetdevil144 commented 8 months ago

Fixed !! (:

akeslo commented 8 months ago

@Sweetdevil144 Thanks for the efforts here, I am for some reason still seeing the error. Do you have an example youtube url that works?

image
Sweetdevil144 commented 8 months ago

Hey @akeslo. Can you try the following : If you scrounge within fetchresults.js, you'll find the lines :

        model: "gpt-4-1106-preview",
        // model: "gpt-3.5-turbo-16k",

Try degrading the model to gpt-3.5 The error arises because your current gpt key is not meant to work with gpt-4 because it requires an organisation's permission. After that, it should work perfectly fine.

akeslo commented 8 months ago

Weird, I swapped that but same error.

Do I need to define anything more in my .env?

OPENAI_API_KEY=sk-xxxxkeyhere Rapid_API_KEY=355keyhere

Sweetdevil144 commented 8 months ago

I don't think I can catch that. Try one thing. log the API keys in your background in fetchresults.js and youtube.js and check whether they are correctly fetched or not. Try using the website Linked within the repository..I think the repository works pretty fine. If that too doesn't works, try logging all responses and errors recieved and sent to openai in API calls. Check if the captions are correctly fetched or not. Sometimes your keys expire so it's difficult to find errors. If nothing works try contacting me again. If possible, can you file a PR too given you find the cause of the problem? It would be a great contribution to our repository. Also, try using nodemon instead of node.

akeslo commented 8 months ago

@Sweetdevil144 Is this supposed to work on all youtube URLs or is there a specific requirement from a caption perspective? I've tried it across several but no luck even with the website linked in the repo. Same error from the website:

image
Sweetdevil144 commented 8 months ago

Thanks for insights @akeslo. Let me take a look into this issue.

Is this supposed to work on all youtube URLs

Yes, this is supposed to work on all shorts.

Sweetdevil144 commented 8 months ago

Seems like my credits of openai have expired on the website. I've improved the log messages on the source code. Can you verify it with your code logs again?

Sweetdevil144 commented 8 months ago

Any updates @akeslo ?

akeslo commented 8 months ago

Sorry for the delay @Sweetdevil144, I am still seeing the same error with the latest code:

╰─$ node app.js Server is running on port 3000 transcript fetched Caught error in app.js An Error occurred -> TypeError: captions is not iterable transcript fetched Caught error in app.js An Error occurred -> TypeError: captions is not iterable