mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-07 20:15:24 +00:00
fix pyinstaller
This commit is contained in:
parent
5e119df765
commit
56e8a45d25
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,3 +10,4 @@ pyvenv.cfg
|
|||||||
videos/
|
videos/
|
||||||
tmp/
|
tmp/
|
||||||
debug.log
|
debug.log
|
||||||
|
run.exe
|
@ -303,9 +303,7 @@ class M3U8_Segments:
|
|||||||
def join(self, output_filename):
|
def join(self, output_filename):
|
||||||
"""Join all segments file to a mp4 file name"""
|
"""Join all segments file to a mp4 file name"""
|
||||||
|
|
||||||
current_dir = os.path.dirname(os.path.realpath(__file__))
|
file_list_path = os.path.join('file_list.txt')
|
||||||
file_list_path = os.path.join(current_dir, 'file_list.txt')
|
|
||||||
|
|
||||||
ts_files = [f for f in os.listdir(self.temp_folder) if f.endswith(".ts")]
|
ts_files = [f for f in os.listdir(self.temp_folder) if f.endswith(".ts")]
|
||||||
|
|
||||||
def extract_number(file_name):
|
def extract_number(file_name):
|
||||||
@ -318,7 +316,7 @@ class M3U8_Segments:
|
|||||||
|
|
||||||
with open(file_list_path, 'w') as f:
|
with open(file_list_path, 'w') as f:
|
||||||
for ts_file in ts_files:
|
for ts_file in ts_files:
|
||||||
relative_path = os.path.relpath(os.path.join(self.temp_folder, ts_file), current_dir)
|
relative_path = os.path.relpath(os.path.join(self.temp_folder, ts_file))
|
||||||
f.write(f"file '{relative_path}'\n")
|
f.write(f"file '{relative_path}'\n")
|
||||||
|
|
||||||
console.log("[cyan]Joining all files...")
|
console.log("[cyan]Joining all files...")
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
__title__ = 'Streaming_community'
|
__title__ = 'Streaming_community'
|
||||||
__version__ = 'v0.9.1'
|
__version__ = 'v0.9.2'
|
||||||
__author__ = 'Ghost6446'
|
__author__ = 'Ghost6446'
|
||||||
__description__ = 'A command-line program to download film'
|
__description__ = 'A command-line program to download film'
|
||||||
__license__ = 'MIT License'
|
__license__ = 'MIT License'
|
||||||
|
@ -10,7 +10,6 @@ import os, requests, time
|
|||||||
repo_name = "StreamingCommunity_api"
|
repo_name = "StreamingCommunity_api"
|
||||||
repo_user = "ghost6446"
|
repo_user = "ghost6446"
|
||||||
main = os.path.abspath(os.path.dirname(__file__))
|
main = os.path.abspath(os.path.dirname(__file__))
|
||||||
base = "\\".join(main.split("\\")[:-1])
|
|
||||||
|
|
||||||
def get_install_version():
|
def get_install_version():
|
||||||
about = {}
|
about = {}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import json
|
import json, os
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
class ConfigManager:
|
class ConfigManager:
|
||||||
def __init__(self, file_path):
|
def __init__(self, file_path):
|
||||||
@ -18,6 +17,6 @@ class ConfigManager:
|
|||||||
|
|
||||||
|
|
||||||
# Example usage:
|
# Example usage:
|
||||||
config_path = Path(__file__).parent.parent.parent / 'config.json'
|
config_path = os.path.join('config.json')
|
||||||
config_manager = ConfigManager(config_path)
|
config_manager = ConfigManager(config_path)
|
||||||
config = config_manager.load_config()
|
config = config_manager.load_config()
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
# 3.12.23 -> 10.12.23
|
# 3.12.23 -> 10.12.23
|
||||||
|
|
||||||
# Import
|
# Import
|
||||||
from random_user_agent.user_agent import UserAgent
|
import fake_useragent
|
||||||
from random_user_agent.params import SoftwareName, OperatingSystem
|
|
||||||
|
# Variable
|
||||||
|
useragent = fake_useragent.UserAgent(use_external_data=True)
|
||||||
|
|
||||||
def get_headers():
|
def get_headers():
|
||||||
software_names = [SoftwareName.CHROME.value]
|
return useragent.firefox
|
||||||
operating_systems = [OperatingSystem.WINDOWS.value, OperatingSystem.LINUX.value]
|
|
||||||
user_agent_rotator = UserAgent(software_names=software_names, operating_systems=operating_systems, limit=10)
|
|
||||||
|
|
||||||
return user_agent_rotator.get_random_user_agent()
|
|
@ -3,7 +3,7 @@ bs4
|
|||||||
lxml
|
lxml
|
||||||
tqdm
|
tqdm
|
||||||
rich
|
rich
|
||||||
random-user-agent
|
fake-useragent==1.1.3
|
||||||
ffmpeg-python
|
ffmpeg-python
|
||||||
cryptography==3.4.8 # Problem with new version
|
cryptography==3.4.8 # Problem with new version
|
||||||
m3u8
|
m3u8
|
||||||
|
2
run.py
2
run.py
@ -115,6 +115,8 @@ def main():
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
main()
|
||||||
|
|
||||||
while 1:
|
while 1:
|
||||||
cmd_insert = input("Quit the script [yes/no]: ")
|
cmd_insert = input("Quit the script [yes/no]: ")
|
||||||
|
|
||||||
|
37
run.spec
Normal file
37
run.spec
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
a = Analysis(
|
||||||
|
['run.py'],
|
||||||
|
pathex=[],
|
||||||
|
binaries=[],
|
||||||
|
datas=[('./Src/upload/__version__.py', 'Src/upload')],
|
||||||
|
hiddenimports=[],
|
||||||
|
hookspath=[],
|
||||||
|
hooksconfig={},
|
||||||
|
runtime_hooks=[],
|
||||||
|
excludes=[],
|
||||||
|
noarchive=False,
|
||||||
|
)
|
||||||
|
pyz = PYZ(a.pure)
|
||||||
|
|
||||||
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
|
a.scripts,
|
||||||
|
a.binaries,
|
||||||
|
a.datas,
|
||||||
|
[],
|
||||||
|
name='run',
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
upx_exclude=[],
|
||||||
|
runtime_tmpdir=None,
|
||||||
|
console=True,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
argv_emulation=False,
|
||||||
|
target_arch=None,
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None,
|
||||||
|
)
|
@ -141,3 +141,5 @@ def main_upload() -> None:
|
|||||||
download_and_extract_latest_commit(repository_owner, repository_name, ["config.json"])
|
download_and_extract_latest_commit(repository_owner, repository_name, ["config.json"])
|
||||||
|
|
||||||
main_upload()
|
main_upload()
|
||||||
|
|
||||||
|
# pyinstaller --onefile --add-data "./Src/upload/__version__.py;Src/upload" run.py
|
||||||
|
Loading…
x
Reference in New Issue
Block a user