Skip to content

Instantly share code, notes, and snippets.

@adinbied
Last active June 21, 2018 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adinbied/13635e5afd7a76cec29e467fb145ba72 to your computer and use it in GitHub Desktop.
Save adinbied/13635e5afd7a76cec29e467fb145ba72 to your computer and use it in GitHub Desktop.
import sys
import requests
for id in sys.argv[1:]:
baseurl = 'https://api.quizlet.com/2.0/sets/'
afterurl = '?client_id=<apikey>'
fullurl = baseurl + str(id) + afterurl
headers = {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36'}
r = requests.get(fullurl, headers=headers)
if r.status_code == 200:
open(str(id) + '.txt', 'wb').write(r.content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment