### Docker Compose for TubeSync with Custom Filters Source: https://github.com/meeb/tubesync/blob/main/docs/custom-filters.md Example Docker Compose configuration for running TubeSync, including volume mounts for configuration, downloads, and custom filter overrides. This allows the custom Python filter logic to be applied to the TubeSync service. ```yaml services: tubesync: image: ghcr.io/meeb/tubesync:latest container_name: tubesync restart: unless-stopped ports: - 4848:4848 volumes: - /some/directory/tubesync-config:/config - /some/directory/tubesync-downloads:/downloads - /some/directory/tubesync-overrides:/app/sync/overrides ``` -------------------------------- ### Install mysqlclient Dependency Source: https://github.com/meeb/tubesync/blob/main/README.md When the pipenv install fails with 'Locking failed' due to the python module mysqlclient, ensure that `mysql_config` or `mariadb_config` is available. On Debian-based systems, this is typically provided by the `libmysqlclient-dev` package. ```bash sudo apt-get install libmysqlclient-dev ``` -------------------------------- ### Start TubeSync Docker Container Source: https://github.com/meeb/tubesync/blob/main/README.md This snippet shows how to run the TubeSync Docker container with essential configurations like user/group IDs, time zone, volume mounts for config and downloads, and port mapping. It's the primary method for launching TubeSync. ```bash docker run \ -d \ --name tubesync \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Europe/London \ -v /some/directory/tubesync-config:/config \ -v /some/directory/tubesync-downloads:/downloads \ -p 4848:4848 \ ghcr.io/meeb/tubesync:latest ``` -------------------------------- ### Create TubeSync Directories (Bash) Source: https://github.com/meeb/tubesync/blob/main/README.md These bash commands create the necessary directories for TubeSync's configuration data and downloaded media. Proper directory setup is crucial for the application's operation and data management. ```bash mkdir /some/directory/tubesync-config mkdir /some/directory/tubesync-downloads ``` -------------------------------- ### TubeSync with PostgreSQL Docker Compose Setup Source: https://github.com/meeb/tubesync/blob/main/docs/other-database-backends.md This Docker Compose configuration sets up TubeSync and its PostgreSQL database. It specifies image versions, container names, volume mappings for data persistence, environment variables for database connection and credentials, and ensures the database is started before TubeSync. ```docker-compose tubesync-db: image: postgres:17 container_name: tubesync-db restart: unless-stopped volumes: - //tubesync-db:/var/lib/postgresql/data environment: - POSTGRES_DB=tubesync - POSTGRES_USER=postgres - POSTGRES_PASSWORD=testpassword tubesync: image: ghcr.io/meeb/tubesync:latest container_name: tubesync restart: unless-stopped ports: - 4848:4848 volumes: - //tubesync/config:/config - //YouTube:/downloads environment: - DATABASE_CONNECTION=postgresql://postgres:testpassword@tubesync-db:5432/tubesync depends_on: - tubesync-db ``` -------------------------------- ### TubeSync Docker Compose Configuration Source: https://github.com/meeb/tubesync/blob/main/README.md Provides a Docker Compose configuration for deploying TubeSync. It defines the service, image, container name, restart policy, port mappings, volume mounts, and environment variables for a persistent setup. ```yaml services: tubesync: image: ghcr.io/meeb/tubesync:latest container_name: tubesync restart: unless-stopped ports: - 4848:4848 volumes: - /some/directory/tubesync-config:/config - /some/directory/tubesync-downloads:/downloads environment: - TZ=Europe/London - PUID=1000 - PGID=1000 ``` -------------------------------- ### TubeSync Cookie Import Log - Success Source: https://github.com/meeb/tubesync/blob/main/docs/using-cookies.md This log message indicates that TubeSync has successfully detected and is using the provided cookies.txt file for authentication with YouTube. ```Log YYYY-MM-DD HH:MM:SS,mmm [tubesync/INFO] [youtube-dl] using cookies.txt from: /config/cookies.txt ``` -------------------------------- ### Pull TubeSync Docker Image (Bash) Source: https://github.com/meeb/tubesync/blob/main/README.md This bash command pulls the latest TubeSync Docker image from the registry. It's a fundamental step in the installation process, ensuring the containerized application is available locally. ```bash docker pull ghcr.io/meeb/tubesync:latest ``` -------------------------------- ### Reset TubeSync Tasks via Command Line Source: https://github.com/meeb/tubesync/blob/main/docs/reset-tasks.md Executes the Django management command to reset all scheduled tasks in TubeSync. This is useful for re-indexing sources and re-downloading missing media information. ```bash ./manage.py reset-tasks ``` ```bash docker exec -ti tubesync python3 /app/manage.py reset-tasks ``` -------------------------------- ### Run Web Service Container with Docker Source: https://github.com/meeb/tubesync/blob/main/docs/youtube-pot.md This shell command shows how to run the `brainicism/bgutil-ytdlp-pot-provider` Docker image, which provides the web service for the YouTube Proof-of-Origin token plugin. It maps port 4416 and sets the container to restart automatically. ```Shell $ docker run -d \ --name bgutil-ytdlp-pot-service \ -p 4416:4416 \ --restart unless-stopped \ brainicism/bgutil-ytdlp-pot-provider:1.2.2 ``` -------------------------------- ### Configure Plugin via Environment Variables Source: https://github.com/meeb/tubesync/blob/main/docs/youtube-pot.md These shell commands demonstrate how to configure the TubeSync plugin to use the web service by setting environment variables for the IP address and port. It also includes instructions on exporting these variables. ```Shell $ TUBESYNC_POT_PORT=4416 $ export TUBESYNC_POT_PORT $ TUBESYNC_POT_IPADDR=[Whatever IP you are using] $ export TUBESYNC_POT_IPADDR ``` -------------------------------- ### Link Docker Containers for Web Service Access Source: https://github.com/meeb/tubesync/blob/main/docs/youtube-pot.md This shell command illustrates how to use Docker's `--link` flag to connect the TubeSync container to the web service container (`bgutil-ytdlp-pot-service`). This automatically creates environment variables for the TubeSync container to access the service. ```Shell $ docker run --link 'bgutil-ytdlp-pot-service:POTServer' # everything else ``` -------------------------------- ### TubeSync Cookie Import Log - Failure Source: https://github.com/meeb/tubesync/blob/main/docs/using-cookies.md This log message indicates an error during the import of the cookies.txt file, specifically that the file is not in the expected Netscape format. ```Log http.cookiejar.LoadError: '/config/cookies.txt' does not look like a Netscape format cookies file ``` -------------------------------- ### Run TubeSync Tests with Django Source: https://github.com/meeb/tubesync/blob/main/README.md Executes the comprehensive test suite for TubeSync, focusing on media format matching and front-end interface functionality. This command is run using the Django management utility. ```Bash ./manage.py test --verbosity=2 ``` -------------------------------- ### Plex Configuration for YouTube Library Source: https://github.com/meeb/tubesync/blob/main/docs/plex-notes.md Provides instructions on configuring a Plex Media Server library to work with TubeSync and YouTube content. It outlines the necessary scanner and agent settings, as well as recommendations for API keys and file naming. ```Text Create a Youtube library as TV Show. Add your Tubesync directory. Set the Scanner to Absolute Series Scanner. Set the Agent to YouTubeSeries. Create your own Youtube API key to pull metadata. ``` -------------------------------- ### Run TubeSync Batch Import Command Source: https://github.com/meeb/tubesync/blob/main/docs/import-existing-media.md Executes the Django command to import existing media into TubeSync. This command scans filenames for unique media identifiers and links them to the appropriate source based on their directory. ```Shell ./manage.py import-existing-media ``` ```Shell docker exec -ti tubesync python3 /app/manage.py import-existing-media ``` -------------------------------- ### Get User ID and Group ID (Bash) Source: https://github.com/meeb/tubesync/blob/main/README.md This bash command helps users identify their current user ID and group ID, which are necessary for correctly mapping volumes when running TubeSync in a Docker container. This ensures proper file permissions. ```bash id # Example output, in this example, user ID = 1000, group ID = 1000 # id uid=1000(username) gid=1000(username) groups=1000(username),129(docker) ``` -------------------------------- ### Configure yt-dlp Plugin with Python Settings Source: https://github.com/meeb/tubesync/blob/main/docs/youtube-pot.md This Python code snippet demonstrates how to configure the YouTube Proof-of-Origin token plugin by setting the base URL in a `local_settings.py` file. It shows the structure for overriding default extractor arguments for the `youtubepot-bgutilhttp` provider. ```Python YOUTUBE_DEFAULTS = { 'extractor_args': { 'youtubepot-bgutilhttp': { 'base_url': ['http://127.0.0.1:4416'], }, }, # ... all the other yt_dlp settings } ``` -------------------------------- ### Enable Basic HTTP Authentication for TubeSync Source: https://github.com/meeb/tubesync/blob/main/README.md Demonstrates how to enable basic username and password authentication for the TubeSync dashboard by setting `HTTP_USER` and `HTTP_PASS` environment variables. This applies to both `docker run` commands and Docker Compose configurations. ```bash docker run \ -d \ --name tubesync \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Europe/London \ -v /some/directory/tubesync-config:/config \ -v /some/directory/tubesync-downloads:/downloads \ -p 4848:4848 \ -e HTTP_USER=some-username \ -e HTTP_PASS=some-secure-password \ ghcr.io/meeb/tubesync:latest ``` ```yaml services: tubesync: image: ghcr.io/meeb/tubesync:latest container_name: tubesync restart: unless-stopped ports: - 4848:4848 volumes: - /some/directory/tubesync-config:/config - /some/directory/tubesync-downloads:/downloads environment: - TZ=Europe/London - PUID=1000 - PGID=1000 - HTTP_USER=some-username - HTTP_PASS=some-secure-password ``` -------------------------------- ### Display Running Tasks in Django Template Source: https://github.com/meeb/tubesync/blob/main/tubesync/sync/templates/sync/tasks.html This snippet iterates through a list of running tasks in a Django template, displaying their names, start times, and links to their respective instances or task IDs. It also handles cases where no tasks are running or the queue is paused. ```Python {% for task in running %} [**{{ task }}** Task started at **{{ task.start_at|date:'Y-m-d H:i:s' }}**]({%if task.instance.pk %}{% url task.url pk=task.instance.pk %}{% else %}#{{ task.task_id }}{% endif %}) {% empty %} There are no running tasks. {% if wait_for_database_queue %} No tasks are running because another task has requested a pause of the queue. While the database tasks are still running, additional tasks will remain scheduled. {% endif %} {% endfor %} ``` -------------------------------- ### Python Custom Filter Function for TubeSync Source: https://github.com/meeb/tubesync/blob/main/docs/custom-filters.md A placeholder for the custom Python filter function in TubeSync. This function, `filter_custom`, should return True to skip downloading an item or False to allow it. It's intended to be placed in a `custom_filter.py` file and mounted into the TubeSync container. ```python # Example structure for custom_filter.py def filter_custom(item): # item is a dictionary containing metadata about the media item # e.g., item['title'], item['age'], item['duration'] # Add your custom filtering logic here # Return True to skip downloading the item # Return False to allow downloading the item # Example: Skip if title contains 'example' if 'example' in item.get('title', '').lower(): return True # Default to allow download if no custom logic skips it return False ``` -------------------------------- ### Test Web Service Connection with curl Source: https://github.com/meeb/tubesync/blob/main/docs/youtube-pot.md This shell command uses `curl` to send a request to the `/ping` endpoint of the web service to verify that it is running and accessible. It checks for a successful JSON response, indicating proper configuration. ```Shell $ no_proxy='127.0.0.1' curl 'http://127.0.0.1:4416/ping' ; echo {"token_ttl_hours":6,"server_uptime":1633.034876421,"version":"0.8.4"} ``` -------------------------------- ### Recommended File Naming Scheme Source: https://github.com/meeb/tubesync/blob/main/docs/plex-notes.md Suggests an optimal file naming scheme for media managed by TubeSync when used with Plex. This scheme aids in metadata recognition and organization, particularly for YouTube content. ```Text {uploader} - {yyyy_mm_dd} - {title_full} [{key}].{ext} ``` -------------------------------- ### Jinja2 Template for Source List Source: https://github.com/meeb/tubesync/blob/main/tubesync/sync/templates/sync/sources.html This Jinja2 template iterates through a list of sources, displaying key information for each, such as name, type, media count, and sync status. It includes links to view source details and trigger a manual sync. It also handles the case where no sources have been added. ```jinja2 {% extends 'base.html' %} {% block headtitle %}Sources{% endblock %} {% block content %} Sources ======= {% include 'infobox.html' with message=message %} [Add a YouTube channel]({% url 'sync:validate-source' source_type='youtube-channel' %}) [Add a YouTube channel by ID]({% url 'sync:validate-source' source_type='youtube-channel-id' %}) [Add a YouTube playlist]({% url 'sync:validate-source' source_type='youtube-playlist' %}) {% for source in sources %} [{{ source.icon|safe }} **{{ source.name }}** ({{ source.get_source_type_display }} "{{ source.key }}") {{ source.format_summary }} {% if source.has_failed %} **Source has permanent failures** {% else %} **{{ source.media_count }}** media items, **{{ source.downloaded_count }}** downloaded {% if source.delete_old_media and source.days_to_keep > 0 %}, keeping {{ source.days_to_keep }} days of media {% endif %} Next update target: **{% if source.target_schedule %}{{ source.target_schedule|date:'l, h:00 A' }}{% else %}Not set{% endif %}** {% endif %} ]({% url 'sync:source' pk=source.pk %}) [Sync Now]({% url 'sync:source-sync-now' pk=source.pk %}) {% empty %} You haven't added any sources. {% endfor %} {% include 'pagination.html' with pagination=sources.paginator %} {% endblock %} ``` -------------------------------- ### Copyright and License Information in Django Template Source: https://github.com/meeb/tubesync/blob/main/tubesync/common/templates/base.html This Jinja snippet displays copyright information, including the current year and the TubeSync developers. It also provides a link to the project's GPLv3 license and its GitHub repository. ```Jinja © {% now 'Y' %} TubeSync developers. The original code under a [GPLv3 licence](https://www.gnu.org/licenses/gpl-3.0.html) is available at [https://github.com/meeb/tubesync](https://github.com/meeb/tubesync). ``` -------------------------------- ### Django Navigation Links Source: https://github.com/meeb/tubesync/blob/main/tubesync/common/templates/base.html This snippet provides a list of navigation links for the TubeSync application, including Dashboard, Sources, Media, Tasks, and Media Servers. Each link is generated using Django's URL tag. ```Jinja * [Dashboard]({% url 'sync:dashboard' %}) * [Sources]({% url 'sync:sources' %}) * [Media]({% url 'sync:media' %}) * [Tasks]({% url 'sync:tasks' %}) * [Media Servers]({% url 'sync:mediaservers' %}) ``` -------------------------------- ### Display Media Server Details (Django Template) Source: https://github.com/meeb/tubesync/blob/main/tubesync/sync/templates/sync/mediaserver.html This Django template snippet displays the details of a media server, including its type, URL, and HTTPS settings. It iterates through server options and provides links to edit or delete the server. ```HTML {% extends 'base.html' %} {% block headtitle %}Media server - {{ mediaserver }}{% endblock %} {% block content %} **{{ mediaserver.get_server_type_display }}** server at **{{ mediaserver.url }}** ==================================================================================== {% include 'infobox.html' with message=message %} {% for name, value in mediaserver.options.items %} {% endfor %} Type Type **{{ mediaserver.get_server_type_display }}** Location Location **{{ mediaserver.url }}** Use HTTPS Use HTTPS **{% if mediaserver.use_https %}{% else %}{% endif %}** Verify HTTPS Verify HTTPS **{% if mediaserver.verify_https %}{% else %}{% endif %}** {{ name|title }} {{ name|title }} **{% if name in private_options %}{{ value|truncatechars:6 }} (hidden){% else %}{{ value }}{% endif %}** [Edit media server]({% url 'sync:update-mediaserver' pk=mediaserver.pk %}) [Delete media server]({% url 'sync:delete-mediaserver' pk=mediaserver.pk %}) {% endblock %} ``` -------------------------------- ### TubeSync Settings for Plex Integration Source: https://github.com/meeb/tubesync/blob/main/docs/plex-notes.md Details the essential TubeSync settings required for seamless integration with Plex. This includes enabling JSON and NFO file generation, copying thumbnails, and configuring media formats. ```Text write JSON (`.info.json`) files write NFO copy thumbnail ``` -------------------------------- ### Follow TubeSync Container Logs Source: https://github.com/meeb/tubesync/blob/main/README.md Streams the logs from the TubeSync container in real-time, allowing for live monitoring of application activity and errors. ```bash docker logs --follow tubesync ``` -------------------------------- ### TubeSync: Copy Database Backup Locally Source: https://github.com/meeb/tubesync/blob/main/docs/other-database-backends.md This command copies the compressed database backup file from the TubeSync container's `/downloads/` directory to the local filesystem at `/tmp/`. This is useful for transferring the backup to your host machine. ```bash $ docker cp \ tubesync:/downloads/tubesync-database-backup.jsonl.xz \ /tmp/ ``` -------------------------------- ### Load Static and Sass Tags in Django Source: https://github.com/meeb/tubesync/blob/main/tubesync/common/templates/base.html This snippet demonstrates loading static files and Sass tags within a Django template. It's a common pattern for web development using Django and Sass. ```Jinja {% load static %}{% load sass_tags %} ``` -------------------------------- ### Display Application Version in Django Template Source: https://github.com/meeb/tubesync/blob/main/tubesync/common/templates/base.html This Jinja snippet displays the application version ('app_version') and the versions of its dependencies, yt-dlp ('yt_dlp_version') and FFmpeg ('ffmpeg_version'), within a Django template. This is useful for displaying build or system information. ```Jinja [TubeSync](https://github.com/meeb/tubesync) version **{{ app_version }}** with [yt-dlp](https://github.com/yt-dlp/yt-dlp) version **{{ yt_dlp_version }}** and [FFmpeg](https://ffmpeg.org/) version **{{ ffmpeg_version }}**. ``` -------------------------------- ### TubeSync: Backup Database with dumpdata Source: https://github.com/meeb/tubesync/blob/main/docs/other-database-backends.md This command stops TubeSync services and then uses the `dumpdata` management command to back up the database into a compressed JSONL file. The output is saved to `/downloads/tubesync-database-backup.jsonl.xz` within the container. ```bash # Stop services $ docker exec -t tubesync \ bash -c 'for svc in \ /run/service/{gunicorn,huey-*,tubesync*-worker} ; \ do \ /command/s6-svc -wd -D "${svc}" ; \ done' # Backup the database into a compressed file $ docker exec -t tubesync \ python3 /app/manage.py \ dumpdata --format jsonl \ --exclude background_task \ --output /downloads/tubesync-database-backup.jsonl.xz ``` -------------------------------- ### TubeSync: Restore Database from Local Backup Source: https://github.com/meeb/tubesync/blob/main/docs/other-database-backends.md This command restores the TubeSync database from a local compressed backup file (`/tmp/tubesync-database-backup.jsonl.xz`). It stops TubeSync services, decompresses the backup using `xzcat`, and pipes the data into the `loaddata` command via standard input. ```bash # Stop services $ docker exec -t tubesync \ bash -c 'for svc in \ /run/service/{gunicorn,huey-*,tubesync*-worker} ; \ do \ /command/s6-svc -wd -D "${svc}" ; \ done' # Load fixture data from standard input into the database $ xzcat /tmp/tubesync-database-backup.jsonl.xz | \ docker exec -i tubesync \ python3 /app/manage.py \ loaddata --format=jsonl - ``` -------------------------------- ### TubeSync Folder Naming for Plex Source: https://github.com/meeb/tubesync/blob/main/docs/plex-notes.md Specifies the required folder naming convention for TubeSync when integrating with Plex using the YouTube-Agent. This ensures proper identification and organization of YouTube channel content. ```Text directory ends with ` [youtube2-UCxxxxx]` media format ends with `[{key}].{ext}` ``` -------------------------------- ### Latest TubeSync Container Image Source: https://github.com/meeb/tubesync/blob/main/README.md This snippet shows the command to pull the latest container image for TubeSync from GitHub Container Registry. It's the initial step for deploying TubeSync in a containerized environment. ```yaml ghcr.io/meeb/tubesync:latest ``` -------------------------------- ### TubeSync: Restore Database with loaddata Source: https://github.com/meeb/tubesync/blob/main/docs/other-database-backends.md This command stops TubeSync services and then uses the `loaddata` management command to restore the database from a compressed JSONL backup file. It assumes the backup file is located at `/downloads/tubesync-database-backup.jsonl.xz` within the container. ```bash # Stop services $ docker exec -t tubesync \ bash -c 'for svc in \ /run/service/{gunicorn,huey-*,tubesync*-worker} ; \ do \ /command/s6-svc -wd -D "${svc}" ; \ done' # Load fixture file into the database $ docker exec -t tubesync \ python3 /app/manage.py \ loaddata /downloads/tubesync-database-backup.jsonl.xz ``` -------------------------------- ### Set Initial CSS for HTML Element Source: https://github.com/meeb/tubesync/blob/main/tubesync/common/templates/base.html This CSS rule sets the initial visibility and opacity of the HTML element to hidden and 0, respectively. This is often used for fade-in or delayed display effects. ```CSS html{ visibility: hidden; opacity: 0; } ``` -------------------------------- ### Django Template - Source Details Display Source: https://github.com/meeb/tubesync/blob/main/tubesync/sync/templates/sync/source.html This snippet displays detailed information about a media source using Django template tags. It includes source properties like name, URL, directory, filtering options, media format, and scheduling. It also conditionally renders messages based on source status (e.g., failures, download caps) and provides links to related actions like viewing media, tasks, editing, or deleting the source. ```HTML {% extends 'base.html' %} {% block headtitle %}Source - {{ source.name }}{% endblock %} {% block content %} Source **{{ source.name }}** ============================ **[{{ source.url }}]({{ source.url }})** Saving to: **{{ source.directory_path }}** [View media linked to this source]({% url 'sync:media' %}?filter={{ source.pk }}) [View tasks linked to this source]({% url 'sync:tasks-completed' %}?filter={{ source.pk }}) {% include 'infobox.html' with message=message %} {% if source.has_failed %}{% include 'errorbox.html' with message='This source has encountered permanent failures listed at the bottom of this page, check its settings' %}{% endif %} {% if source.filter_seconds %} {% endif %} {% if source.download_cap > 0 %} {% endif %} {% if source.is_video %} {% endif %} {% if source.delete_old_media and source.days_to_keep > 0 %} {% else %} {% endif %} {% if source.enable_sponsorblock %} {% endif %} {% if source.write_subtitles %} {% endif %} Type Type **{{ source.get_source_type_display }}** Name Name **{{ source.name }}** Media items Media items **[{{ media|length }}]({% url 'sync:media' %}?filter={{ source.pk }})** Key Key **{{ source.key }}** Directory Directory **{{ source.directory }}** Filter text{% if source.filter_text_invert %} _Inverted_{% endif %} Filter text{% if source.filter_text_invert %} _Inverted_{% endif %} **{{ source.filter_text }}** Filter Seconds Filter seconds **{{ source.filter_seconds }}s {% if source.filter_seconds_min %}(Minimum length){% else %}(Maximum Length){% endif %}** Media format Media format **{{ source.media_format }}** Example filename Example filename **{{ source.get_example_media_format }}** Download cap Download cap **{{ source.get_download_cap_display }}** Index schedule Index schedule **{{ source.get_index_schedule_display }}** Index videos? Index videos? **{% if source.index_videos %}{% else %}{% endif %}** Index streams? Index streams? **{% if source.index_streams %}{% else %}{% endif %}** Download media? Download media? **{% if source.download_media %}{% else %}{% endif %}** Created Created **{{ source.created|date:'Y-m-d H:i:s' }}** Last crawl Last crawl **{% if source.last_crawl %}{{ source.last_crawl|date:'Y-m-d H:i:s' }}{% else %}Never{% endif %}** Target schedule Target schedule **{% if source.target_schedule %}{{ source.target_schedule|date:'l, h:00 A (c)' }}{% else %}Not set{% endif %}** Source resolution Source resolution **{{ source.get_source_resolution_display }}** Source video codec Source video codec **{{ source.get_source_vcodec_display }}** Source audio codec Source audio codec **{{ source.get_source_acodec_display }}** Prefer 60FPS? Prefer 60FPS? **{% if source.prefer_60fps %}{% else %}{% endif %}** Prefer HDR? Prefer HDR? **{% if source.prefer_hdr %}{% else %}{% endif %}** Output extension Output extension **{{ source.extension }}** Fallback Fallback **{{ source.get_fallback_display }}** Copy thumbnails? Copy thumbnails? **{% if source.copy_thumbnails %}{% else %}{% endif %}** Write NFO? Write NFO? **{% if source.write_nfo %}{% else %}{% endif %}** Write JSON? Write JSON? **{% if source.write_json %}{% else %}{% endif %}** Delete removed media Delete removed media **{% if source.delete_removed_media %}{% else %}{% endif %}** Delete files on disk Delete files on disk **{% if source.delete_files_on_disk %}{% else %}{% endif %}** Delete old media Delete old media **After {{ source.days_to_keep }} days** Delete old media Delete old media **No, keep forever** UUID UUID **{{ source.uuid }}** {{ _("Embed thumbnail?") }}: {{ _("Embed thumbnail?") }} {{ _("Embed metadata?") }}: {{ _("Embed metadata?") }} {{ _("SponsorBlock?") }}: {{ _("Sponsorblock enabled?") }} {{ _("What blocked?") }}: {{ _("What blocked?") }} **{% if source.sponsorblock_categories.all_choice in source.sponsorblock_categories.selected_choices %} {% for k,v in source.sponsorblock_categories.possible_choices %} {{ v }}: {% endfor %} {% else %} {% for c in source.sponsorblock_categories.selected_choices %} {% for k,v in source.sponsorblock_categories.possible_choices %} {% if k == c %} {{ v }}: {% endif %} {% endfor %} {% endfor %} {% endif %}** {{ _("Download subtitles?") }}: {{ _("Download subtitles?") }}: {{ _("Auto-generated subtitles?") }}: {{ _("Auto-generated subtitles?") }}: {{ _("Subs langs?") }}: {{ _("Subs langs?") }}:**{{source.sub_langs}}** [Edit source]({% url 'sync:update-source' pk=source.pk %}) [Delete source]({% url 'sync:delete-source' pk=source.pk %}) {% if errors %} Source has encountered {{ errors|length }} Error{{ errors|length|pluralize }} ----------------------------------------------------------------------------- {% for task in errors %} **{{ task.verbose_name }}** Error: "{{ task.error_message }}" {% endif %} {% endif %} {% endblock %} ``` -------------------------------- ### Redownload Media Template Source: https://github.com/meeb/tubesync/blob/main/tubesync/sync/templates/sync/media-redownload.html This Jinja2 template displays the option to redownload media. It extends a base template, sets the page title, and includes a form for the redownload action. It also displays the media title and provides a button to confirm the action. ```Jinja2 {% extends 'base.html' %} {% block headtitle %}Redownload media - {{ media }}{% endblock %} {% block content %} Redownload media **{{ media }}** ================================ You can delete the downloaded file for your media **{{ media }}** and schedule it to be redownloaded. You might want to use this if you moved the original file on disk and want to download it again, or, if you changed your source settings such as changed the desired resolution and want to redownload the media in a different format. {% csrf_token %} {% include 'simpleform.html' with form=form %} Really delete and redownload media {% endblock %} ``` -------------------------------- ### Create Django Superuser via Docker Source: https://github.com/meeb/tubesync/blob/main/README.md This command allows you to create a superuser account for the Django admin interface within a running TubeSync Docker container. This is useful for accessing and managing the application's administrative functions. ```bash docker exec -it tubesync python3 /app/manage.py createsuperuser ``` -------------------------------- ### Django URL for Dashboard Navigation Source: https://github.com/meeb/tubesync/blob/main/tubesync/common/templates/base.html This Jinja code generates a URL for the 'sync:dashboard' view, typically used for navigation within the TubeSync application. It allows users to link to the main dashboard page. ```Jinja ({% url 'sync:dashboard' %}) ``` -------------------------------- ### Update TubeSync Docker Image Source: https://github.com/meeb/tubesync/blob/main/README.md Command to pull the latest version of the TubeSync Docker image. Replace `[number]` with the specific version tag you wish to update to. ```bash docker pull ghcr.io/meeb/tubesync:v[number] ``` -------------------------------- ### Extract TubeSync Logs to File Source: https://github.com/meeb/tubesync/blob/main/README.md Redirects all logs from the TubeSync container to a file named `TubeSync.logs.txt`. This is useful for capturing logs to share for debugging or reporting issues. ```bash docker logs -t tubesync > TubeSync.logs.txt 2>&1 ``` -------------------------------- ### Django Block for Dynamic Content Source: https://github.com/meeb/tubesync/blob/main/tubesync/common/templates/base.html This Jinja syntax defines a content block named 'content' within a Django template. This allows child templates to override or extend this section with their specific HTML. ```Jinja {% block content %}{% endblock %} ```