Tag: Transmission

  • Restart Transmission from Synology Terminal

    /var/packages/transmission/scripts/start-stop-status stop
    /var/packages/transmission/scripts/start-stop-status start

    …or:

    synopkg restart transmission
  • Transmission Config Location for Synology from SynoCommunity

    The base directory is:

    /volume1/@appstore/transmission

    Most settings/config file and torrents are stored under:

    /volume1/@appstore/transmission/var
    /volume1/@appstore/transmission/var/torrents

    To edit these files, you need sudo permission. For example:

    "watch-dir": "/volume2/data_2/torrents-watch",
    "watch-dir-enabled": true
  • Install Transmission on CentOS 7

    Nowadays it’s really simple to install Transmission on CentOS 7 or EL distro. First you need to install EPEL packages:

    $ yum install epel-release
    $ yum -y update
    

    …or use the following command if you’re running Red Hat Enterprise Linux:

    $ yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(rpm -E '%{rhel}').noarch.rpm
    

    Install Transmission:

    $ yum install transmission-cli transmission-common transmission-daemon
    

    Create storage directory:

    $ mkdir /ebs-data/transmission/
    $ chown -R transmission.transmission /ebs-data/transmission/
    

    Start and stop the Transmission to auto generate configs:

    $ systemctl start transmission-daemon.service
    $ systemctl stop transmission-daemon.service
    

    To edit the config, you MUST first stop the daemon, otherwise the config will be overwritten after you restart the daemon:

    $ systemctl stop transmission-daemon.service
    $ var /var/lib/transmission/.config/transmission-daemon/settings.json
    

    Edit config:

    "download-dir": "/ebs-data/transmission",
    "incomplete-dir": "/ebs-data/transmission",
    "rpc-authentication-required": true,
    "rpc-enabled": true,
    "rpc-password": "my_password",
    "rpc-username": "my_user",
    "rpc-whitelist": "0.0.0.0",
    "rpc-whitelist-enabled": false,
    

    Save and start daemon:

    $ systemctl start transmission-daemon.service
    

    Access via your browser:

    $ open http://localhost:9091/transmission/web/
    
  • FlexGet + Transmission + Plex AniDB Agent on macOS

    目標

    • 自動下載新番種子
    • 種子自動加入 Transmission 下載隊列
    • 新番文件自動重命名到 Plex 兼容格式
    • 通過 Plex AniDB agent 自動獲取新番相關信息

    總結:基於 FlexGet 和 Transmission 的全自動追番方案

    實現方法

    • 通過 FlexGet 讀取 RSS,自動下載種子文件,通過正則自動剔除無效字符
    • 通過 FlexGet 的 transmissionrpc 插件自動將種子傳送到 Transmission
    • Transmission 下載完成後觸發腳本,自動將種子重命名為 Plex 可識別格式
    • 通過 Plex 的第三方插件 Hama.bundle 自動獲取新番相關訊息

    配料表

    • 裝有 macOS 的電腦一部
    • Plex
    • Transmission
    • FlexGet

    配置 FlexGet(2021 版)

    最新版本配置採用 FlexGet 內置的 manipulate 方法,對 RSS 直接修改為符合 Plex 查詢標準的文件名,避免了使用 Transmission 調用外掛腳本的方案,下面的正則可根據實際場景進行修改:

      bangumi:
        template: torrent
        manipulate:
          - title:
              # remove underscores
              replace:
                regexp: '_'
                format: ''
          - title:
              replace:
                regexp: '★'
                format: ''
          - title:
              extract: '^[\[【].*?[\]】](.*)'
          - title:
              replace:
                regexp: '【'
                format: '['
          - title:
              replace:
                regexp: '】'
                format: ']'
          - title:
              replace:
                regexp: '】'
                format: ']'
          - title:
              replace:
                regexp: '(?:\[|【)(简体|簡體|繁体|繁體|简日双语|繁日雙語|GB|BIG5|MP4)(?:\]|】)'
                format: ''
          - title:
              replace:
                regexp: '(?:\[|【|第)(\d\d)(?:\]|】|話|话)'
                # format: 's01e\1'
                format: '\1'
          - title:
              # replace `][` to ` ` (space)
              replace:
                regexp: '\]\['
                format: ' '
          - title:
              # remove leftover brackets
              replace:
                regexp: '[\[\]【】]'
                format: ' '
          - title:
              replace:
                regexp: '(?:.*字幕 (?: 组|組))'
                format: ''
          - title:
              replace:
                regexp: '\[(?:.+? 月新? 番)'
                format: ''
        set:
          path: /Volumes/Gizur/Downloads/Anime/{{ series_name }}
          content_filename: '{{ series_name }} - {{ series_id|pad(2) }}'
          magnetization_timeout: 45
        series:
          - スーパーカブ:
              alternate_name: 本田小狼與我 Super Cub
          - ダイナ莊びより:
              alternate_name: 恐龍日和
          - 回復術士のやり直し 〜即死魔法とスキルコピーの超越ヒール〜:

    配置 FlexGet(2013 版,無需再看)

    FlexGet 的安裝方法和自動運行請參考參考 官方文檔,寫的很詳細

    配置文件如下,要點在於 presets.global.transmission.path,為了能讓 Plex 識別和方便管理,每一個動畫 要分別放在相應命名的目錄。其中 {{task}} 對應的就是 tasks 下的新番標題:

    presets:
      global:
        accept_all: true
        transmission:
          host: localhost
          port: 9091
          addpaused: No
          ratio: 0.01
          removewhendone: Yes
          path: "/Volumes/Backups HD/Anime/{{task}}/"
    tasks:
      WHITE ALBUM2:
        rss: http://bt.ktxp.com/rss-search-%E6%BE%84%E7%A9%BA%E5%AD%A6%E5%9B%AD+%E7%99%BD%E8%89%B2%E7%9B%B8%E7%B0%BF+2+MP4+720p.xml
      アウトブレイク・カンパニー:
        rss: http://bt.ktxp.com/rss-search-%E6%BE%84%E7%A9%BA%E5%AD%A6%E5%9B%AD+%E8%90%8C%E8%90%8C%E4%BE%B5%E7%95%A5%E8%80%85+MP4+720p.xml
      ガリレイドンナ:
        rss: http://bt.ktxp.com/rss-search-%E6%BE%84%E7%A9%BA%E5%AD%A6%E5%9B%AD+%E4%BC%BD%E5%88%A9%E7%95%A5%E5%B0%91%E5%A5%B3+%E7%AE%80%E4%BD%93+MP4+720p.xml
      キルラキル:
        rss: http://bt.ktxp.com/rss-search-%E6%A5%B5%E5%BD%B1%E5%AD%97%E5%B9%95%E7%A4%BE+Kill+La+Kill+BIG5+MP4+720p.xml
      京騒戯画:
        rss: http://bt.ktxp.com/rss-search-WOLF+%E4%BA%AC%E9%AA%9A%E6%88%8F%E7%94%BB+GB+720P+MP4.xml
      凪のあすから:
        rss: http://bt.ktxp.com/rss-search-%E5%8B%95%E6%BC%AB%E5%9C%8B+%E4%BE%86%E8%87%AA%E9%A2%A8%E5%B9%B3%E6%B5%AA%E9%9D%9C%E7%9A%84%E6%98%8E%E5%A4%A9+720P+%E7%B9%81%E9%AB%94+MP4.xml
      境界の彼方:
        rss: http://bt.ktxp.com/rss-search-%E6%BE%84%E7%A9%BA%E5%AD%A6%E5%9B%AD+%E5%A2%83%E7%95%8C%E7%9A%84%E5%BD%BC%E6%96%B9+%E7%AE%80%E4%BD%93+MP4+720p.xml
      夜桜四重奏 ~ハナノウタ~:
        rss: http://bt.ktxp.com/rss-search-%E6%A5%B5%E5%BD%B1%E5%AD%97%E5%B9%95%E7%A4%BE+%E5%A4%9C%E6%AB%BB%E5%9B%9B%E9%87%8D%E5%A5%

    配置 Transmission

    如果使用了 2021 版的方案,請略過本段

    Transmission 本身不需要進行過多配置,為了避免下載隊列越來越多,記得勾選下載完成後從隊列刪除這個選項。下面是其對應的 post-process 腳本:

    #!/bin/sh
    
    # Search all subdirectories
    # Use rename -n for dry-run
    cd /Volumes/Backups\ HD/Anime
    find . -name '*.mp4' -print0 | xargs -0 /usr/local/bin/rename -f 's/\[(.*)\]\[(.*)\]\[(\d{2})\].*$/$2 - $3\.mp4/'

    上述腳本會通過正則將 [Fansub][Title][Episode]*.mp4 這樣的格式替換為 Plex 可識別的 Title - Episode.mp4 格式,例如 [WOLF&HYSUB][Kyousougiga][00][GB][720P][MP4].mp4 就會被替換為 Kyousougiga - 00.mp4

    配置 Plex w/ Hama Agent

    注意!,已棄用 AniDB agent,改為 Hama Agent 。詳情請訪問最新文章:Hama (HTTP Anidb Metadata Agent) and Plex Media Server – 2014-04-09

    訪問 Plex 論壇 下載 AniDB agent 并安裝,通過 Plex 的 web 界面進行管理即可

    完成配置後可通過下列指令進行 dry run 測試:

    flexget -c ~/.flexget/config.yml --test execute

    以下是效果圖: