0

I'm trying to use YoutubeAPI to get the URLs from each video within a playlist. I found some code to help me do this, however, they use a print statement with an F string and a for loop that iterates over each video in the playlist. The problem is, I'm using python 3.5, when this came out in Python 3.6, so I was wondering how I may be able to get around this.

print([ f'https://www.youtube.com/watch?v={t["snippet"]["resourceId"]["videoId"]}&list={playlist_id}&t=0s' for t in playlist_items ])

1 Answer 1

2

Something like this

for t in playlist_items:
    print('https://www.youtube.com/watch?v={}&list={}&t=0s'.format(t["snippet"]["resourceId"]["videoId"], playlist_id))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.