Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions python/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# tab of
# https://cloud.google.com/console
# Please ensure that you have enabled the YouTube Data API for your project.

DEVELOPER_KEY = 'REPLACE_ME'
YOUTUBE_API_SERVICE_NAME = 'youtube'
YOUTUBE_API_VERSION = 'v3'
Expand Down Expand Up @@ -50,9 +51,10 @@ def youtube_search(options):
playlists.append('%s (%s)' % (search_result['snippet']['title'],
search_result['id']['playlistId']))

print 'Videos:\n', '\n'.join(videos), '\n'
print 'Channels:\n', '\n'.join(channels), '\n'
print 'Playlists:\n', '\n'.join(playlists), '\n'
print('Videos:\n', '\n'.join(videos), '\n')
print('Channels:\n', '\n'.join(channels), '\n')
print('Playlists:\n', '\n'.join(playlists), '\n')
print()


if __name__ == '__main__':
Expand All @@ -63,5 +65,5 @@ def youtube_search(options):

try:
youtube_search(args)
except HttpError, e:
print 'An HTTP error %d occurred:\n%s' % (e.resp.status, e.content)
except HttpError as e:
print('An HTTP error %d occurred:\n%s' % (e.resp.status, e.content))