Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 33 lines (27 sloc) 0.698 kb
#!/usr/bin/env python
import requests
import subprocess
import sys
import os
api = 'http://www.furk.net/api/plugins/metasearch?api_key=%s&pretty=1&q=' % os.environ['FURK_KEY']
args = sys.argv[1:]
if not args:
exit()
results = requests.get(api+' '.join(args)).json['files']
for i, r in reversed(list(enumerate(results, 1))):
if int(r['is_ready']):
print '%-2d: %s' % (i, r['name'])
while True:
try:
result = results[int(raw_input('number: '))-1]
url = result['url_pls']
except (EOFError, KeyboardInterrupt):
print
break
except KeyError:
print result
except Exception, e:
pass
else:
subprocess.Popen(['vlc', url])
break
Jump to Line
Something went wrong with that request. Please try again.