PyPIでライブラリを揃える
pyenv local 2.7.10
pip install Animapy
pip install py-applescript
あとは下記スクリプトを実行
anime_play.py
import os
import applescript
from animapy import anime
search = raw_input('search: (string) ')
index = int(raw_input('index: (integer) '))
qt_play = applescript.AppleScript('''
on run {arg1}
tell Application "QuickTime Player"
open URL arg1
end tell
end run
''')
qt_close = applescript.AppleScript('''
tell Application "QuickTime Player" to close window 1
''')
def play(s):
for ep in anime.searchAnimes(s, quant=1):
if ep == '': continue
url = hasattr(ep, 'hd') and ep.hd or ep.normal
print('starting to play %s' % ep.title)
return qt_play.run(url)
while(1):
play('%s %03d' % (search, index))
raw_input('Enter to next index movie: ')
qt_close.run()
index+=1
説明
- スクリプトを実行しローマ字でアニメのタイトルを入力しエンター
- 話数を整数で入力する
- エンターを押すたびに次の話数が再生される
- ^Cとかで終わる
注意: Macユーザー向けになっちゃった。