Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update search.py #564

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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))