Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Using API link to display video on .html without using iframe - My adviser told me not to use iframe [duplicate]

$
0
0

From my .html page

<a href="{{ link }}" target="_blank" ><img src= "https://image.tmdb.org/t/p/w500/{{movie.poster_path}}"></a> </br>

From my main.py

@app.route("/movies/\<movie_id\>")def show_movie(movie_id):movie = crud.get_movie_by_id(movie_id)base_url = 'https://api.themoviedb.org/3/movie/'APIkey = '/videos?api_key='APIlink = base_url + movie_id + APIkeyprint(APIlink)response = requests.get(APIlink)video_data = response.json()print(video_data['results'][0])key = video_data['results'][0]['key']link = "https://www.youtube.com/watch?v=" + keyreturn render_template("movie_details.html", movie=movie, link=link)`

I have this code on my .html page. How could I modify the codes to display the videos on the same page? Could I create a .js file to do it? Please help! I remove the APIKEY, which is from themovietb, could you please add your API key if you try:


Viewing all articles
Browse latest Browse all 3831

Trending Articles