My code ends by an error 405 even if I have allowed the GET method. When I am in localhost, it perfectly works, but I see this error in github page or pythonanywhere.
What could be the problem here ?
@app.route('/')
def my_home():
return render_template('index.html')
@app.route('/submit', methods=['POST','GET'])
def submit():
ytlink = request.form['yt link']
lang = request.form['lang']
Transcriptions = YouTubeTranscriptApi.get_transcript(ytlink, languages=[lang])
formatter = TextFormatter()
text_formatted = formatter.format_transcript(Transcriptions)
return text_formatted
Here is some of the template :
<!DOCTYPE html>
<html>
<body>
<title>Youtube transcription</title>
<h1>Download your transcription</h1>
<form action="/submit" method='POST'>
<label for="ytlink"><strong>YT id of the video:</label></strong>
<input type="text" id="yt link" name="yt link">
<br>
<label for="language"><strong>Language:</label></strong>
<input type="text" id="lang" name="lang">
<br>
<input type="submit" value="Click here to see your transcription", name='submit'>
</form>
</body>
</html>