mirror of
https://github.com/chibicitiberiu/ytsm.git
synced 2024-02-24 05:43:31 +00:00
Merge pull request #1 from J-tt/master
Docker integration, using gunicorn+nginx
This commit is contained in:
commit
555707962f
2
.gitignore
vendored
2
.gitignore
vendored
@ -113,3 +113,5 @@ venv.bak/
|
||||
.mypy_cache/
|
||||
.dmypy.json
|
||||
dmypy.json
|
||||
|
||||
media/
|
||||
|
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@ -0,0 +1,17 @@
|
||||
FROM python:3
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install ffmpeg -y
|
||||
|
||||
COPY ./app/requirements.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY ./app/ .
|
||||
COPY ./config/ ./config/
|
||||
|
||||
#RUN python manage.py migrate
|
||||
|
||||
CMD ["python", "./manage.py", "runserver", "8000", "--noreload"]
|
||||
#CMD ["gunicorn", "YtManager.wsgi", "--bind", "0.0.0.0:8000"]
|
@ -20,6 +20,12 @@ This is what still needs to be done:
|
||||
* Improve stability
|
||||
* Bonus: Plex integration
|
||||
|
||||
# Docker
|
||||
|
||||
To run with docker, edit the config file (config/config.ini) and then run `docker-compose up -d`, it will bind to port 80.
|
||||
|
||||
You can edit the default download locations in the docker-compose.yml file.
|
||||
|
||||
## Dependencies
|
||||
|
||||
* python3: `$ apt install python3`
|
@ -26,7 +26,7 @@ YOUTUBE_API_KEY = "AIzaSyBabzE4Bup77WexdLMa9rN9z-wJidEfNX8"
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = []
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
SESSION_COOKIE_AGE = 3600 * 30 # one month
|
||||
|
||||
@ -81,11 +81,14 @@ WSGI_APPLICATION = 'YtManager.wsgi.application'
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'postgres',
|
||||
'USER': 'postgres',
|
||||
'HOST': 'db',
|
||||
'PORT': 5432,
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
|
Before Width: | Height: | Size: 229 B After Width: | Height: | Size: 229 B |
Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 247 B |
Before Width: | Height: | Size: 182 KiB After Width: | Height: | Size: 182 KiB |
59
app/config/config.ini
Normal file
59
app/config/config.ini
Normal file
@ -0,0 +1,59 @@
|
||||
; Use $<env:environment_variable> to use the value of an environment variable.
|
||||
; The global section contains settings that apply to the entire server
|
||||
[global]
|
||||
; YouTube API key - get this from your user account
|
||||
;YoutubeApiKey=
|
||||
|
||||
; Specifies the synchronization schedule, in crontab format.
|
||||
; Format: <minute> <hour> <day-of-month> <month-of-year> <day of week>
|
||||
SynchronizationSchedule=5 * * * *
|
||||
|
||||
; Number of threads running the scheduler
|
||||
; Since most of the jobs scheduled are downloads, there is no advantage to having
|
||||
; a higher concurrency
|
||||
SchedulerConcurrency=1
|
||||
|
||||
; Log level
|
||||
LogLevel=DEBUG
|
||||
|
||||
; Default user settings
|
||||
[user]
|
||||
; When a video is deleted on the system, it will be marked as 'watched'
|
||||
MarkDeletedAsWatched=True
|
||||
|
||||
; Videos marked as watched are automatically deleted
|
||||
DeleteWatched=True
|
||||
|
||||
; Enable automatic downloading
|
||||
AutoDownload=True
|
||||
|
||||
; Limit the total number of videos downloaded (-1 or empty = no limit)
|
||||
DownloadGlobalLimit=10
|
||||
|
||||
; Limit the numbers of videos per subscription (-1 or empty = no limit)
|
||||
DownloadSubscriptionLimit=5
|
||||
|
||||
; Number of download attempts
|
||||
DownloadMaxAttempts=3
|
||||
|
||||
; Download order
|
||||
; Options: newest, oldest, playlist, playlist_reverse, popularity, rating
|
||||
DownloadOrder=playlist
|
||||
|
||||
; Path where downloaded videos are stored
|
||||
DownloadPath=data/media/videos
|
||||
|
||||
; A pattern which describes how downloaded files are organized. Extensions are automatically appended.
|
||||
; Supported fields: channel, channel_id, playlist, playlist_id, playlist_index, title, id
|
||||
; The default pattern should work pretty well with Plex
|
||||
;DownloadFilePattern=${channel}/${playlist}/S01E${playlist_index} - ${title} [${id}]
|
||||
|
||||
; Download format that will be passed to youtube-dl. See the youtube-dl documentation for more details.
|
||||
DownloadFormat=bestvideo+bestaudio
|
||||
|
||||
; Subtitles - these options match the youtube-dl options
|
||||
;DownloadSubtitles=True
|
||||
;DownloadAutogeneratedSubtitles=False
|
||||
;DownloadSubtitlesAll=False
|
||||
;DownloadSubtitlesLangs=en,ro
|
||||
;DownloadSubtitlesFormat=
|
59
app/config/defaults.ini
Normal file
59
app/config/defaults.ini
Normal file
@ -0,0 +1,59 @@
|
||||
; Use $<env:environment_variable> to use the value of an environment variable.
|
||||
; The global section contains settings that apply to the entire server
|
||||
[global]
|
||||
; YouTube API key - get this from your user account
|
||||
YoutubeApiKey=AIzaSyBabzE4Bup77WexdLMa9rN9z-wJidEfNX8
|
||||
|
||||
; Specifies the synchronization schedule, in crontab format.
|
||||
; Format: <minute> <hour> <day-of-month> <month-of-year> <day of week>
|
||||
SynchronizationSchedule=0 * * * *
|
||||
|
||||
; Number of threads running the scheduler
|
||||
; Since most of the jobs scheduled are downloads, there is no advantage to having
|
||||
; a higher concurrency
|
||||
SchedulerConcurrency=2
|
||||
|
||||
; Log level
|
||||
LogLevel=INFO
|
||||
|
||||
; Default user settings
|
||||
[user]
|
||||
; When a video is deleted on the system, it will be marked as 'watched'
|
||||
MarkDeletedAsWatched=True
|
||||
|
||||
; Videos marked as watched are automatically deleted
|
||||
DeleteWatched=True
|
||||
|
||||
; Enable automatic downloading
|
||||
AutoDownload=True
|
||||
|
||||
; Limit the total number of videos downloaded (-1 or empty = no limit)
|
||||
DownloadGlobalLimit=
|
||||
|
||||
; Limit the numbers of videos per subscription (-1 or empty = no limit)
|
||||
DownloadSubscriptionLimit=5
|
||||
|
||||
; Number of download attempts
|
||||
DownloadMaxAttempts=3
|
||||
|
||||
; Download order
|
||||
; Options: newest, oldest, playlist, playlist_reverse, popularity, rating
|
||||
DownloadOrder=playlist
|
||||
|
||||
; Path where downloaded videos are stored
|
||||
DownloadPath=${env:USERPROFILE}${env:HOME}/Downloads
|
||||
|
||||
; A pattern which describes how downloaded files are organized. Extensions are automatically appended.
|
||||
; Supported fields: channel, channel_id, playlist, playlist_id, playlist_index, title, id
|
||||
; The default pattern should work pretty well with Plex
|
||||
DownloadFilePattern=${channel}/${playlist}/S01E${playlist_index} - ${title} [${id}]
|
||||
|
||||
; Download format that will be passed to youtube-dl. See the youtube-dl documentation for more details.
|
||||
DownloadFormat=bestvideo+bestaudio
|
||||
|
||||
; Subtitles - these options match the youtube-dl options
|
||||
DownloadSubtitles=True
|
||||
DownloadAutogeneratedSubtitles=False
|
||||
DownloadSubtitlesAll=False
|
||||
DownloadSubtitlesLangs=en,ro
|
||||
DownloadSubtitlesFormat=
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user