10 temp_folder
= '/tmp/rarfstmp'
12 def play_rar_arhchive(archive
, options
=""):
13 os
.system("mkdir " + temp_folder
)
14 os
.system("fusermount -u " + temp_folder
)
15 os
.system("rarfs \"" + archive
+ "\" " + temp_folder
)
16 os
.system("find " + temp_folder
+ " | xargs -n 1 mplayer -cache-min 0 -cache 8000 -fs " + options
)
17 os
.system("fusermount -u " + temp_folder
)
18 os
.system("rmdir " + temp_folder
)
21 def find_rar_archive(path
):
23 for x
in os
.listdir(path
):
24 if ( os
.path
.isdir(os
.path
.join(path
,x
)) ):
25 ret
+= find_rar_archive(os
.path
.join(path
,x
))
27 if ( x
.endswith(".rar") ):
28 if ( x
[-11:-6] == ".part" ):
29 if ( x
[-11:] == ".part01.rar" ):
30 ret
+= [os
.path
.join(path
,x
)]
31 elif ( x
[-12:-7] == ".part" ):
32 if ( x
[-11:] == ".part001.rar" ):
33 ret
+= [os
.path
.join(path
,x
)]
34 elif ( x
[-13:-8] == ".part" ):
35 if ( x
[-11:] == ".part0001.rar" ):
36 ret
+= [os
.path
.join(path
,x
)]
38 ret
+= [os
.path
.join(path
,x
)]
43 rars
+= find_rar_archive(os
.path
.join(os
.path
.abspath(os
.curdir
),n
))
44 os
.chdir(os
.environ
.get('HOME'))