Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions PluginDirectories/1/thetvdb.bundle/examples.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tvdb ~tvdbquery(query here)
8 changes: 8 additions & 0 deletions PluginDirectories/1/thetvdb.bundle/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "TheTVDB",
"displayName": "TheTVDB Search",
"description": "Search TheTVDB from Spotlight.",
"examples": ["tvdb blacklist"],
"categories": ["Search"],
"creator_name": "Knoobie",
}
27 changes: 27 additions & 0 deletions PluginDirectories/1/thetvdb.bundle/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import urllib, json, i18n

def results(parsed, original_query):
search_specs = [
["tvdb", "~tvdbquery", "http://thetvdb.com/?searchseriesid=&tab=listseries&function=Search&string="]
]
for name, key, url in search_specs:
if key in parsed:
url = i18n.localstr(url)
search_url = url + urllib.quote_plus(parsed[key].encode('utf-8'))
return {
"title": i18n.localstr("Search {0} for '{1}'").format(name, parsed[key].encode('utf-8')),
"run_args": [search_url],
"html": """
<script>
setTimeout(function() {
window.location = %s
}, 500);
</script>
"""%(json.dumps(search_url)),
"webview_user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53",
"webview_links_open_in_browser": True
}

def run(url):
import os
os.system('open "{0}"'.format(url))