-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest2.py
37 lines (27 loc) · 784 Bytes
/
test2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import glob
import os
import sys
import time
import thread
from outsearch import OutSearch
from medialib import Torrent
def play():
sample_dir = 'sample/'
print "Select one of the available files:"
torrent_files = glob.glob(sample_dir+'*')
for i,v in enumerate(torrent_files):
print i, ' ', v
tf = int(raw_input("Please enter torrent number: "))
import player
tp = player.TorrentPlayer()
tp.load_filepath(torrent_files[tf])
t = Torrent()
t.torrent_file = torrent_files[tf]
OutSearch().loadFilesList(t)
subfiles = t.files
for v in subfiles:
print v.subfile_no, ' ', v.title
sf = int(raw_input("Please enter subfile number: "))
tp.select_file(sf)
thread.start_new_thread(tp.play,())
return tp