Project Icon

Plex-Auto-Languages

智能化Plex TV剧集语言管理工具

Plex-Auto-Languages是一款智能化Plex TV剧集语言管理工具。它可自动根据用户当前语言更新剧集音频和字幕,无需逐集手动调整。支持多用户独立设置、按季或单集更新、定时任务和通知功能。兼容Docker和Python环境,安装简便,为用户提供流畅的多语言观影体验。

Plex Auto Languages

GitHub Build Docker Pulls Version Codecov License

This application lets you have a Netflix-like experience by auto-updating the language of your Plex TV Show episodes based on the current language you are using without messing with your existing language preferences.

You want to watch Squid Game in korean with english subtitles ?
Set the language for the first episode and don't think about it for the rest of the show. :heavy_check_mark:

You want to watch The Mandalorian in english but still want to watch Game of Thrones in french ?
Don't worry, the language is set per TV Show and it won't interfere. :heavy_check_mark:

You have multiple managed and shared users with various preferences ?
The proper tracks will be selected automatically and independently for all your users. :heavy_check_mark:

Getting Started

The application requires a Plex Token, if you don't know how to find yours, please see the official guide.

The recommended way of running this application is by using Docker. A Docker image is available on Docker Hub and installation instructions are detailed below.

PlexAutoLanguages can also be run natively with Python, see the detailed instructions.

Docker installation

Docker compose minimal configuration

Here is a minimal example of a docker-compose configuration:

version: "3"
services:
  plexautolanguages:
    image: remirigal/plex-auto-languages:latest
    environment:
      - PLEX_URL=http://plex:32400
      - PLEX_TOKEN=MY_PLEX_TOKEN
      - TZ=Europe/Paris
    volumes:
      - ./config:/config

Docker compose advanced configuration

Here is an example of a docker-compose configuration that uses a YAML configuration file config.yaml inside a config directory, see Configuration for more information:

version: "3"
services:
  plexautolanguages:
    image: remirigal/plex-auto-languages:latest
    container_name: PlexAutoLanguages
    environment:
      - TZ=Europe/Paris
    volumes:
      # make sure you have a file named 'config.yaml' in the 'config' dir
      - ./config:/config
    restart: unless-stopped

Python installation

This application requires Python 3 and has only been tested with Python 3.8 and higher.

Start by cloning the repository:

git clone git@github.com:RemiRigal/Plex-Auto-Languages.git

Install the required dependencies:

cd Plex-Auto-Languages
python3 -m pip install -r requirements.txt

Create a YAML configuration file (config.yaml for example) based on the template showed in the configuration section below. Note that only the parameters plex.url and plex.token are required.

You can now start PlexAutoLanguages (don't forget to change the name of the configuration file if yours is different):

python3 main.py -c ./config.yaml

Configuration

The application can be configured either with environment variables or with a YAML file mounted at /config/config.yaml. Every parameter listed in this section can be overriden with the corresponding environment variables (eg. the environment variable PLEX_URL will override the parameter plex.url, NOTIFICATIONS_ENABLE will override the parameter notifications.enable etc...).

The Plex Token can also be provided as a Docker secret, the filepath of the secret must then be specified in the environment variable PLEX_TOKEN_FILE which defaults to /run/secrets/plex_token.

Here is an example of a complete configuration file:

plexautolanguages:
  # Update language for the entire show or only for the current season
  # Accepted values:
  #   - show (default)
  #   - season
  update_level: "show"

  # Update all episodes of the show/season or only the next ones
  # Accepted values:
  #   - all (default)
  #   - next
  update_strategy: "all"

  # Whether or not playing a file should trigger a language update, defaults to 'true'
  trigger_on_play: true

  # Whether or not scanning the library for new files should trigger a language update, defaults to 'true'
  # A newly added episode will be updated based on the most recently watched episode, or the first episode of the show if it has never been watched
  trigger_on_scan: true

  # Whether or not navigating the Plex library should trigger a language update, defaults to 'false'
  # Only the Plex web client and the Plex for Windows app support this feature
  # Set this to 'true' only if you want to perform changes whenever the default track of an episode is updated, even when the episode is not played.
  # Setting this parameter to 'true' can result in higher resource usage.
  trigger_on_activity: false

  # Whether or not to refresh the cached library whenever the Plex server scans its own library, defaults to 'true'
  # Disabling this parameter will prevent PlexAutoLanguages from detecting updated files for an already existing episode
  # It is recommended to disable this parameter if you have a large TV Show library (10k+ episodes)
  refresh_library_on_scan: true

  # PlexAutoLanguages will ignore shows with any of the following Plex labels
  ignore_labels:
    - PAL_IGNORE

  # Plex configuration
  plex:
    # A valid Plex URL (required)
    url: "http://plex:32400"
    # A valid Plex Token (required)
    token: "MY_PLEX_TOKEN"

  scheduler:
    # Whether of not to enable the scheduler, defaults to 'true'
    # The scheduler will perform a deeper analysis of all recently played TV Shows
    enable: true
    # The time at which the scheduler start its task with the format 'HH:MM', defaults to '02:00'
    schedule_time: "04:30"

  notifications:
    # Whether or not to enable the notifications through Apprise, defaults to 'false'
    # A notification is sent whenever a language change is performed
    enable: true
    # An array of Apprise configurations, see Apprise docs for more information: https://github.com/caronc/apprise
    # The array 'users' can be specified in order to link notification URLs with specific users
    #   Defaults to all users if not present
    # The array 'events' can be specified in order to get notifications only for specific events
    #   Valid event values: "play_or_activity" "new_episode" "updated_episode" "scheduler"
    #   Defaults to all events if not present
    apprise_configs:
      # This URL will be notified of all changes during all events
      - "discord://webhook_id/webhook_token"
      # These URLs will only be notified of language change for users "MyUser1" and "MyUser2"
      - urls:
          - "gotify://hostname/token"
          - "pover://user@token"
        users:
          - "MyUser1"
          - "MyUser2"
      # This URL will only be notified of language change for user "MyUser3" during play or activity events
      - urls:
          - "tgram://bottoken/ChatID"
        users:
          - "MyUser3"
        events:
          - "play_or_activity"
      # This URL will be notified of language change during scheduler tasks only
      - urls:
          - "gotify://hostname/token"
        events:
          - "scheduler"
      - "..."

  # Whether or not to enable the debug mode, defaults to 'false'
  # Enabling debug mode will significantly increase the number of output logs
  debug: false

License

This application is licensed under the MIT License.

项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

白日梦AI

白日梦AI提供专注于AI视频生成的多样化功能,包括文生视频、动态画面和形象生成等,帮助用户快速上手,创造专业级内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

讯飞绘镜

讯飞绘镜是一个支持从创意到完整视频创作的智能平台,用户可以快速生成视频素材并创作独特的音乐视频和故事。平台提供多样化的主题和精选作品,帮助用户探索创意灵感。

Project Cover

讯飞文书

讯飞文书依托讯飞星火大模型,为文书写作者提供从素材筹备到稿件撰写及审稿的全程支持。通过录音智记和以稿写稿等功能,满足事务性工作的高频需求,帮助撰稿人节省精力,提高效率,优化工作与生活。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

SubCat字幕猫

SubCat字幕猫APP是一款创新的视频播放器,它将改变您观看视频的方式!SubCat结合了先进的人工智能技术,为您提供即时视频字幕翻译,无论是本地视频还是网络流媒体,让您轻松享受各种语言的内容。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号