Skip to content

Instantly share code, notes, and snippets.

@dorukcan
Created October 4, 2014 09:58
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 dorukcan/9e570892156b65ed9015 to your computer and use it in GitHub Desktop.
Save dorukcan/9e570892156b65ed9015 to your computer and use it in GitHub Desktop.
episodecalendar.com to trakt.tv
import requests
import hashlib
import json
def markaswatched():
"""
marks episodes which are marked on episodecalendar as seen on trakt. because episodecalendar forced me to buy premium version. fuck you episodecalendar.
http://trakt.tv/api-docs/show-episode-seen
"""
user = "username comes to here"
passw = hashlib.sha1("password comes to here").hexdigest() #they want sha1 encoded password
#export your data as a json file from http://episodecalendar.com/account/edit#7
ecFile = json.load( open("C:\Users\Doruk\Desktop\episodecalendar-data.json") )
data = {"username": user,
"password": passw,
"title": "",
"episodes": []}
title = ecFile[0]["show"]
for episode in ecFile:
if title != episode["show"]:
if data["episodes"] != []:
r = requests.post('http://api.trakt.tv/show/episode/seen/e66ae4b64761e4e72ede067271a12bbf', data=json.dumps(data))
print r.text , title
data["title"] = episode["show"]
if episode["watched"] == "true":
data["episodes"] = [{"season": episode["season"], "episode": episode["number"]}]
else:
data["episodes"] = []
title = episode["show"]
else:
if episode["watched"] == "true":
data["episodes"].append({"season": episode["season"], "episode": episode["number"]})
if __name__ == '__main__':
markaswatched()
@DjYegaz
Copy link

DjYegaz commented Feb 13, 2017

C:\Users\admin\Desktop>python gistfile1.py
File "gistfile1.py", line 27
print r.text , title
^
SyntaxError: Missing parentheses in call to 'print'

Any idea?

@leoslamas
Copy link

C:\Users\admin\Desktop>python gistfile1.py
File "gistfile1.py", line 27
print r.text , title
^
SyntaxError: Missing parentheses in call to 'print'

Try using python 2.7 or just do what the SyntaxError says, use print(r.text, title)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment