mirror of
https://github.com/dmunozv04/iSponsorBlockTV.git
synced 2025-12-06 03:46:44 +03:00
move directories and data path
This commit is contained in:
75
.github/workflows/main.yml
vendored
75
.github/workflows/main.yml
vendored
@@ -1,75 +0,0 @@
|
|||||||
name: build docker images
|
|
||||||
|
|
||||||
# Controls when the workflow will run
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- '*'
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- '*'
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
# Get the repository's code
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# Generate docker tags
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: ghcr.io/dmunozv04/isponsorblocktv, dmunozv04/isponsorblocktv
|
|
||||||
tags: |
|
|
||||||
type=raw,value=develop,priority=900,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
|
|
||||||
type=ref,enable=true,priority=600,prefix=pr-,suffix=,event=pr
|
|
||||||
type=ref,event=tag
|
|
||||||
type=ref,event=branch
|
|
||||||
type=schedule
|
|
||||||
|
|
||||||
# https://github.com/docker/setup-qemu-action
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
# https://github.com/docker/setup-buildx-action
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
|
|
||||||
- name: Login to DockerHub
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Login to GHCR
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64, linux/arm64
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
cache-from: type=registry,ref=ghcr.io/dmunozv04/isponsorblocktv:buildcache
|
|
||||||
cache-to: type=registry,ref=ghcr.io/dmunozv04/isponsorblocktv:buildcache,mode=max
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
FROM python:alpine3.11
|
FROM python:alpine3.11
|
||||||
|
|
||||||
ENV PIP_NO_CACHE_DIR=off iSPBTV_docker=True TERM=xterm-256color COLORTERM=truecolor
|
ENV PIP_NO_CACHE_DIR=off iSPBTV_docker=True iSPBTV_data_dir=data TERM=xterm-256color COLORTERM=truecolor
|
||||||
|
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
|
|
||||||
@@ -13,6 +13,8 @@ COPY requirements.txt .
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN python -m compileall .
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
ENTRYPOINT ["python3", "-u", "main.py"]
|
ENTRYPOINT ["python3", "-u", "main.py"]
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
from iSponsorBlockTV import helpers
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
|
|
||||||
if getattr(sys, "frozen", False):
|
|
||||||
os.environ["SSL_CERT_FILE"] = os.path.join(sys._MEIPASS, "lib", "cert.pem")
|
|
||||||
helpers.app_start()
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
# -*- mode: python ; coding: utf-8 -*-
|
|
||||||
|
|
||||||
from PyInstaller.utils.hooks import exec_statement
|
|
||||||
cert_datas = exec_statement("""
|
|
||||||
import ssl
|
|
||||||
print(ssl.get_default_verify_paths().cafile)""").strip().split()
|
|
||||||
cert_datas = [(f, 'lib') for f in cert_datas]
|
|
||||||
|
|
||||||
block_cipher = None
|
|
||||||
|
|
||||||
options = [ ('u', None, 'OPTION') ]
|
|
||||||
|
|
||||||
a = Analysis(['main-macos.py'],
|
|
||||||
pathex=[],
|
|
||||||
binaries=[],
|
|
||||||
datas=cert_datas,
|
|
||||||
hiddenimports=['certifi'],
|
|
||||||
hookspath=[],
|
|
||||||
hooksconfig={},
|
|
||||||
runtime_hooks=[],
|
|
||||||
excludes=[],
|
|
||||||
win_no_prefer_redirects=False,
|
|
||||||
win_private_assemblies=False,
|
|
||||||
cipher=block_cipher,
|
|
||||||
noarchive=False)
|
|
||||||
pyz = PYZ(a.pure, a.zipped_data,
|
|
||||||
cipher=block_cipher)
|
|
||||||
|
|
||||||
exe = EXE(pyz,
|
|
||||||
a.scripts,
|
|
||||||
a.binaries,
|
|
||||||
a.zipfiles,
|
|
||||||
a.datas,
|
|
||||||
[],
|
|
||||||
options,
|
|
||||||
name='iSponsorBlockTV-macos',
|
|
||||||
debug=False,
|
|
||||||
bootloader_ignore_signals=False,
|
|
||||||
strip=False,
|
|
||||||
upx=True,
|
|
||||||
upx_exclude=[],
|
|
||||||
runtime_tmpdir=None,
|
|
||||||
console=True,
|
|
||||||
disable_windowed_traceback=False,
|
|
||||||
target_arch=None,
|
|
||||||
codesign_identity=None,
|
|
||||||
entitlements_file=None)
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
appdirs==1.4.4
|
||||||
aiohttp==3.8.6
|
aiohttp==3.8.6
|
||||||
argparse==1.4.0
|
argparse==1.4.0
|
||||||
async-cache==1.1.1
|
async-cache==1.1.1
|
||||||
@@ -7,4 +8,3 @@ ssdp==1.3.0
|
|||||||
textual==0.40.0
|
textual==0.40.0
|
||||||
textual-slider==0.1.1
|
textual-slider==0.1.1
|
||||||
xmltodict==0.13.0
|
xmltodict==0.13.0
|
||||||
|
|
||||||
|
|||||||
8
src/iSponsorBlockTV/__main__.py
Normal file
8
src/iSponsorBlockTV/__main__.py
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
from . import helpers
|
||||||
|
|
||||||
|
def main():
|
||||||
|
helpers.app_start()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -5,6 +5,8 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
from appdirs import user_data_dir
|
||||||
|
|
||||||
from . import config_setup, main, setup_wizard
|
from . import config_setup, main, setup_wizard
|
||||||
|
|
||||||
|
|
||||||
@@ -102,8 +104,10 @@ class Config:
|
|||||||
|
|
||||||
|
|
||||||
def app_start():
|
def app_start():
|
||||||
|
#If env has a data dir use that, otherwise use the default
|
||||||
|
default_data_dir = os.getenv("iSPBTV_data_dir") or user_data_dir("iSponsorBlockTV", "dmunozv04")
|
||||||
parser = argparse.ArgumentParser(description="iSponsorblockTV")
|
parser = argparse.ArgumentParser(description="iSponsorblockTV")
|
||||||
parser.add_argument("--data-dir", "-d", default="data", help="data directory")
|
parser.add_argument("--data-dir", "-d", default=default_data_dir, help="data directory")
|
||||||
parser.add_argument("--setup", "-s", action="store_true", help="setup the program graphically")
|
parser.add_argument("--setup", "-s", action="store_true", help="setup the program graphically")
|
||||||
parser.add_argument("--setup-cli", "-sc", action="store_true", help="setup the program in the command line")
|
parser.add_argument("--setup-cli", "-sc", action="store_true", help="setup the program in the command line")
|
||||||
parser.add_argument("--debug", action="store_true", help="debug mode")
|
parser.add_argument("--debug", action="store_true", help="debug mode")
|
||||||
Reference in New Issue
Block a user