From 108644736935fa5143ec2077ac56d7b94ff1eee0 Mon Sep 17 00:00:00 2001 From: RRRRRm Date: Mon, 5 Aug 2019 03:00:35 +0800 Subject: [PATCH] Fix the path error under Linux. Specify Python3 as the runtime. --- ADC_function.py | 1 + AV_Data_Capture.py | 41 +++++++++++++++++++++-------------------- core.py | 1 + fc2fans_club.py | 3 ++- javbus.py | 3 ++- javdb.py | 3 ++- siro.py | 3 ++- 7 files changed, 31 insertions(+), 24 deletions(-) mode change 100644 => 100755 ADC_function.py mode change 100644 => 100755 AV_Data_Capture.py mode change 100644 => 100755 core.py mode change 100644 => 100755 fc2fans_club.py mode change 100644 => 100755 javbus.py mode change 100644 => 100755 javdb.py mode change 100644 => 100755 siro.py diff --git a/ADC_function.py b/ADC_function.py old mode 100644 new mode 100755 index 476560e..2b76958 --- a/ADC_function.py +++ b/ADC_function.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # -*- coding: utf-8 -*- import requests diff --git a/AV_Data_Capture.py b/AV_Data_Capture.py old mode 100644 new mode 100755 index 7d4da3c..4788aa3 --- a/AV_Data_Capture.py +++ b/AV_Data_Capture.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # -*- coding: utf-8 -*- import glob @@ -30,26 +31,26 @@ def UpdateCheck(): print('[+]Update Check disabled!') def movie_lists(): if config['directory_capture']['switch'] == '0' or config['directory_capture']['switch'] == '': - a2 = glob.glob(r".\*.mp4") - b2 = glob.glob(r".\*.avi") - c2 = glob.glob(r".\*.rmvb") - d2 = glob.glob(r".\*.wmv") - e2 = glob.glob(r".\*.mov") - f2 = glob.glob(r".\*.mkv") - g2 = glob.glob(r".\*.flv") - h2 = glob.glob(r".\*.ts") + a2 = glob.glob(r'./*.mp4') # 使用 '/' 可以同时兼容Linux + b2 = glob.glob(r'./*.avi') + c2 = glob.glob(r'./*.rmvb') + d2 = glob.glob(r'./*.wmv') + e2 = glob.glob(r'./*.mov') + f2 = glob.glob(r'./*.mkv') + g2 = glob.glob(r'./*.flv') + h2 = glob.glob(r'./*.ts') total = a2 + b2 + c2 + d2 + e2 + f2 + g2 + h2 return total elif config['directory_capture']['switch'] == '1': directory = config['directory_capture']['directory'] - a2 = glob.glob(r".\\" + directory + "\*.mp4") - b2 = glob.glob(r".\\" + directory + "\*.avi") - c2 = glob.glob(r".\\" + directory + "\*.rmvb") - d2 = glob.glob(r".\\" + directory + "\*.wmv") - e2 = glob.glob(r".\\" + directory + "\*.mov") - f2 = glob.glob(r".\\" + directory + "\*.mkv") - g2 = glob.glob(r".\\" + directory + "\*.flv") - h2 = glob.glob(r".\\" + directory + "\*.ts") + a2 = glob.glob(r"./" + directory + "/*.mp4") + b2 = glob.glob(r"./" + directory + "/*.avi") + c2 = glob.glob(r"./" + directory + "/*.rmvb") + d2 = glob.glob(r"./" + directory + "/*.wmv") + e2 = glob.glob(r"./" + directory + "/*.mov") + f2 = glob.glob(r"./" + directory + "/*.mkv") + g2 = glob.glob(r"./" + directory + "/*.flv") + h2 = glob.glob(r"./" + directory + "/*.ts") total = a2 + b2 + c2 + d2 + e2 + f2 + g2 + h2 return total def CreatFailedFolder(): @@ -121,11 +122,11 @@ def getNumber(filepath): def RunCore(): if os.path.exists('core.py'): - os.system('python core.py' + ' "' + i + '" --number "'+getNumber(i)+'"') #从py文件启动(用于源码py) + os.popen(sys.executable + ' core.py' + ' "' + i + '" --number "'+getNumber(i)+'"') #从py文件启动(用于源码py) elif os.path.exists('core.exe'): - os.system('core.exe' + ' "' + i + '" --number "'+getNumber(i)+'"') #从exe启动(用于EXE版程序) + os.popen('core.exe' + ' "' + i + '" --number "'+getNumber(i)+'"') #从exe启动(用于EXE版程序) elif os.path.exists('core.py') and os.path.exists('core.exe'): - os.system('python core.py' + ' "' + i + '" --number "' + getNumber(i) + '"') #从py文件启动(用于源码py) + os.popen(sys.executable + ' core.py' + ' "' + i + '" --number "' + getNumber(i) + '"') #从py文件启动(用于源码py) if __name__ =='__main__': print('[*]===========AV Data Capture===========') @@ -147,4 +148,4 @@ if __name__ =='__main__': CEF('JAV_output') print("[+]All finished!!!") - input("[+][+]Press enter key exit, you can check the error messge before you exit.\n[+][+]按回车键结束,你可以在结束之前查看和错误信息。") \ No newline at end of file + input("[+][+]Press enter key exit, you can check the error messge before you exit.\n[+][+]按回车键结束,你可以在结束之前查看和错误信息。") diff --git a/core.py b/core.py old mode 100644 new mode 100755 index 0120dda..b9a41c8 --- a/core.py +++ b/core.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re diff --git a/fc2fans_club.py b/fc2fans_club.py old mode 100644 new mode 100755 index 9915a87..3b0686a --- a/fc2fans_club.py +++ b/fc2fans_club.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import re from lxml import etree#need install import json @@ -81,4 +82,4 @@ def main(number2): js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'),)#.encode('UTF-8') return js -#print(main('1051725')) \ No newline at end of file +#print(main('1051725')) diff --git a/javbus.py b/javbus.py old mode 100644 new mode 100755 index 6f3a465..a36f934 --- a/javbus.py +++ b/javbus.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import re import requests #need install from pyquery import PyQuery as pq#need install @@ -173,4 +174,4 @@ def main_uncensored(number): js2 = javdb.main(number) return js2 - return js \ No newline at end of file + return js diff --git a/javdb.py b/javdb.py old mode 100644 new mode 100755 index 3723117..faf96aa --- a/javdb.py +++ b/javdb.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import re from lxml import etree import json @@ -137,4 +138,4 @@ def main(number): js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8') return js -#print(main('061519-861')) \ No newline at end of file +#print(main('061519-861')) diff --git a/siro.py b/siro.py old mode 100644 new mode 100755 index 0cd8b09..6cbc1ee --- a/siro.py +++ b/siro.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import re from lxml import etree import json @@ -101,4 +102,4 @@ def main(number2): js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'),)#.encode('UTF-8') return js -#print(main('300maan-373')) \ No newline at end of file +#print(main('300maan-373'))