mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-24 05:56:37 +00:00
Merge branch 'main' of github.com:meeb/tubesync
This commit is contained in:
commit
4a24fd1109
@ -325,7 +325,7 @@ Notable libraries and software used:
|
|||||||
* [django-sass](https://github.com/coderedcorp/django-sass/)
|
* [django-sass](https://github.com/coderedcorp/django-sass/)
|
||||||
* The container bundles with `s6-init` and `nginx`
|
* The container bundles with `s6-init` and `nginx`
|
||||||
|
|
||||||
See the [Pipefile](https://github.com/meeb/tubesync/blob/main/Pipfile) for a full list.
|
See the [Pipfile](https://github.com/meeb/tubesync/blob/main/Pipfile) for a full list.
|
||||||
|
|
||||||
### Can I get access to the full Django admin?
|
### Can I get access to the full Django admin?
|
||||||
|
|
||||||
@ -353,7 +353,12 @@ etc.). Configuration of this is beyond the scope of this README.
|
|||||||
|
|
||||||
### What architectures does the container support?
|
### What architectures does the container support?
|
||||||
|
|
||||||
Just `amd64` for the moment. Others may be made available if there is demand.
|
Only two are supported, for the moment:
|
||||||
|
- `amd64` (most desktop PCs and servers)
|
||||||
|
- `arm64`
|
||||||
|
(modern ARM computers, such as the Rasperry Pi 3 or later)
|
||||||
|
|
||||||
|
Others may be made available, if there is demand.
|
||||||
|
|
||||||
### The pipenv install fails with "Locking failed"!
|
### The pipenv install fails with "Locking failed"!
|
||||||
|
|
||||||
|
@ -193,10 +193,15 @@ class ValidateSourceView(FormView):
|
|||||||
Source.SOURCE_TYPE_YOUTUBE_PLAYLIST: ('https://www.youtube.com/playlist?list='
|
Source.SOURCE_TYPE_YOUTUBE_PLAYLIST: ('https://www.youtube.com/playlist?list='
|
||||||
'PL590L5WQmH8dpP0RyH5pCfIaDEdt9nk7r')
|
'PL590L5WQmH8dpP0RyH5pCfIaDEdt9nk7r')
|
||||||
}
|
}
|
||||||
|
_youtube_domains = frozenset({
|
||||||
|
'youtube.com',
|
||||||
|
'm.youtube.com',
|
||||||
|
'www.youtube.com',
|
||||||
|
})
|
||||||
validation_urls = {
|
validation_urls = {
|
||||||
Source.SOURCE_TYPE_YOUTUBE_CHANNEL: {
|
Source.SOURCE_TYPE_YOUTUBE_CHANNEL: {
|
||||||
'scheme': 'https',
|
'scheme': 'https',
|
||||||
'domains': ('m.youtube.com', 'www.youtube.com'),
|
'domains': _youtube_domains,
|
||||||
'path_regex': '^\/(c\/)?([^\/]+)(\/videos)?$',
|
'path_regex': '^\/(c\/)?([^\/]+)(\/videos)?$',
|
||||||
'path_must_not_match': ('/playlist', '/c/playlist'),
|
'path_must_not_match': ('/playlist', '/c/playlist'),
|
||||||
'qs_args': [],
|
'qs_args': [],
|
||||||
@ -205,7 +210,7 @@ class ValidateSourceView(FormView):
|
|||||||
},
|
},
|
||||||
Source.SOURCE_TYPE_YOUTUBE_CHANNEL_ID: {
|
Source.SOURCE_TYPE_YOUTUBE_CHANNEL_ID: {
|
||||||
'scheme': 'https',
|
'scheme': 'https',
|
||||||
'domains': ('m.youtube.com', 'www.youtube.com'),
|
'domains': _youtube_domains,
|
||||||
'path_regex': '^\/channel\/([^\/]+)(\/videos)?$',
|
'path_regex': '^\/channel\/([^\/]+)(\/videos)?$',
|
||||||
'path_must_not_match': ('/playlist', '/c/playlist'),
|
'path_must_not_match': ('/playlist', '/c/playlist'),
|
||||||
'qs_args': [],
|
'qs_args': [],
|
||||||
@ -214,7 +219,7 @@ class ValidateSourceView(FormView):
|
|||||||
},
|
},
|
||||||
Source.SOURCE_TYPE_YOUTUBE_PLAYLIST: {
|
Source.SOURCE_TYPE_YOUTUBE_PLAYLIST: {
|
||||||
'scheme': 'https',
|
'scheme': 'https',
|
||||||
'domains': ('m.youtube.com', 'www.youtube.com'),
|
'domains': _youtube_domains,
|
||||||
'path_regex': '^\/(playlist|watch)$',
|
'path_regex': '^\/(playlist|watch)$',
|
||||||
'path_must_not_match': (),
|
'path_must_not_match': (),
|
||||||
'qs_args': ('list',),
|
'qs_args': ('list',),
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import os
|
import os
|
||||||
from urllib.parse import urljoin
|
|
||||||
from django.core.wsgi import get_wsgi_application
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
|
||||||
|
|
||||||
@ -16,10 +15,9 @@ def application(environ, start_response):
|
|||||||
else:
|
else:
|
||||||
raise Exception(f'DJANGO_URL_PREFIX must end with a /, '
|
raise Exception(f'DJANGO_URL_PREFIX must end with a /, '
|
||||||
f'got: {DJANGO_URL_PREFIX}')
|
f'got: {DJANGO_URL_PREFIX}')
|
||||||
if script_name:
|
if script_name is not None:
|
||||||
static_url = urljoin(script_name, 'static/')
|
|
||||||
environ['SCRIPT_NAME'] = script_name
|
environ['SCRIPT_NAME'] = script_name
|
||||||
path_info = environ['PATH_INFO']
|
path_info = environ['PATH_INFO']
|
||||||
if path_info.startswith(script_name) and not path_info.startswith(static_url):
|
if path_info.startswith(script_name):
|
||||||
environ['PATH_INFO'] = path_info[len(script_name) - 1:]
|
environ['PATH_INFO'] = path_info[len(script_name) - 1:]
|
||||||
return _application(environ, start_response)
|
return _application(environ, start_response)
|
||||||
|
38
tubesync/upgrade_yt-dlp.sh
Executable file
38
tubesync/upgrade_yt-dlp.sh
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
warning_message() {
|
||||||
|
cat <<EOM
|
||||||
|
Please report any issues that you have encountered before updating yt-dlp.
|
||||||
|
|
||||||
|
This is a tool to assist developers with debugging YouTube issues.
|
||||||
|
It should not be used as an alternative to updating container images!
|
||||||
|
EOM
|
||||||
|
} 1>&2
|
||||||
|
|
||||||
|
pip3() {
|
||||||
|
local pip_runner pip_whl run_whl
|
||||||
|
|
||||||
|
# pipenv
|
||||||
|
pip_runner='/usr/lib/python3/dist-packages/pipenv/patched/pip/__pip-runner__.py'
|
||||||
|
test -s "${pip_runner}" || pip_runner=''
|
||||||
|
|
||||||
|
# python3-pip-whl
|
||||||
|
pip_whl="$(ls -1r /usr/share/python-wheels/pip-*-py3-none-any.whl | head -n 1)"
|
||||||
|
run_whl="${pip_whl}/pip"
|
||||||
|
|
||||||
|
python3 "${pip_runner:-"${run_whl}"}" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
warning_message
|
||||||
|
test -n "${TUBESYNC_DEBUG}" || exit 1
|
||||||
|
|
||||||
|
# Use the flag added in 23.0.1, if possible.
|
||||||
|
# https://github.com/pypa/pip/pull/11780
|
||||||
|
break_system_packages='--break-system-packages'
|
||||||
|
pip_version="$(pip3 --version | awk '$1 = "pip" { print $2; exit; }')"
|
||||||
|
if [[ "${pip_version}" < "23.0.1" ]]; then
|
||||||
|
break_system_packages=''
|
||||||
|
fi
|
||||||
|
|
||||||
|
pip3 install --upgrade ${break_system_packages} yt-dlp
|
||||||
|
|
Loading…
Reference in New Issue
Block a user