Code Monkey home page Code Monkey logo

bazarr-sync's Introduction

bazarr-sync

image

Bulk sync your subtitles to your media.

Bazarr let you download subs for your titles automatically. But if for some reason you needed to sync old subtitles, wither you need to do it because you have not synced them before or you have edited them elsewhere, you will be forced to do it one by one as there is no option to bulk sync them except a per series option which won't help if you would like to sync movies or if you have several shows. This cli tool help you achieve that by utilizing bazarr's api.

Installation

Go

  • Install go in your system. this can be done through here. https://go.dev/doc/install
  • After installation in a terminal install the module
go install github.com/ajmandourah/bazarr-sync/cmd/bazarr-sync@latest

make sure your go path is included in your path. you should be able to use the command directly with bazarr-sync or bazarr-sync.exe in windows.

Docker

pull the image

sudo docker pull ghcr.io/ajmandourah/bazarr-sync:latest

create or copy the config.yaml file from the example folder. edit it to your settings. for docker you can use the bazarr container name if you have bazarr in a bridged network (not the default docker network). change the network name in the command. Run the command in the same folder where the config.yaml is located. change the command to your desired functionfor example bazarr-sync sync shows

sudo docker run -it --rm \
-v ${PWD}/config.yaml:/usr/src/app/config.yaml \
--network <NETWORK_NAME> \
ghcr.io/ajmandourah/bazarr-sync:latest \
bazarr-sync sync movies

Configuration

use the provided config.yaml file as a template. fill in the required fields. either direct the flag --config to your config file or place it in the working directiory where you bazarr-sync is located.

#config file example, please don't use quotes
###########################
#
#Address: the address of your bazarr instance. this can be either an ip address or a url (if you reverse proxy bazarr), 
#this can also be bazarr's container name if you use docker, make sure bazarr-sync instance is in the same network as bazarr and the network not the default
#docker network as name resolution won't happen there.
Address: <bazarr_address>
#
#Port: bazarrs port. by default bazarr uses 6767. in case of reverse proxy, you can use 443 or 80 as per your configuration 
Port: <port>
#
#protocol: this can be http or https
Protocol: https
#
#ApiToken: you can get this from bazarr setting>general . no quotes needed.
ApiToken: <Bazarr_api_token>

Usage:

Make sure to create a config.yaml file including your configuration in it.
Use the provided config file as a template.

Usage:
  bazarr-sync [command]

Examples:
bazarr-sync --config config.yaml sync movies --no-framerate-fix

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  sync        Sync subtitles to the audio track of the media

Flags:
      --config string      config file (default is ./config.yaml)
      --golden-section     Use Golden-Section Search
  -h, --help               help for bazarr-sync
      --no-framerate-fix   Don't try to fix framerate

Sync all movies subtitles

bazarr-sync --config config.yaml sync movies

Sync all tv shows subtitles

bazarr-sync --config config.yaml sync shows

Syncing specefic movie/show subtitle

The functionality to enable syncing specefic movies/shows are added. to do so follow these steps:

  • use the --list flag to view a list of your Shows/Movies with their respective sonarr/radarr ids. the output will shows as follows
Title                                                                                               | SonarrSeriesId
--------------------------------------------------------------------------------------------------------------------
3 Body Problem                                                                                      | 1304
The Apothecary Diaries                                                                              | 1043
As a Reincarnated Aristocrat, I'll Use My Appraisal Skill To Rise in the World                      | 953
Avatar: The Last Airbender (2024)                                                                   | 1341
The Banished Former Hero Lives as He Pleases                                                        | 961
  • note the ids of your desired shows/movies to be synced
  • use the usual sync command and add the flag --radarr-id or --sonarr-id
  • PROFIT

Example:

bazarr-sync --config config.yaml sync shows --sonarr-id 1302,953,961

Syncing both movies and shows

You can sync both movies and shows in the same time. what I recommend is using tmux and run the tool in 2 windows. this will assure that you won't loose progress. image

bazarr-sync's People

Contributors

ajmandourah avatar

Stargazers

 avatar  avatar Felix H avatar JoaoPSVieira avatar Attila Szabó avatar Felix Benoit avatar  avatar Georgi Sariev avatar Thierry avatar  avatar apeman avatar  avatar  avatar  avatar  avatar titan901 avatar fern avatar Dennis van Strien avatar  avatar  avatar  avatar  avatar  avatar Jan De Luyck avatar Cameron Garrett avatar Haashim avatar le Duc Banal avatar  avatar Anthony avatar Jon avatar  avatar Lucas Dell'Isola avatar Arshad Hosein avatar  avatar BinkieSmalls avatar

Watchers

 avatar

Forkers

madejackson

bazarr-sync's Issues

Bulk sync on bazarr

Heya,

Just an FYI,

There is a bulk sync (albeit, per show) on Bazarr.

image

The readme may need to be updated just in case this crops up again as a question.

Kubernetes Template

Working Kubernetes-Template for my K3s-Cluster, for anyone is interested:

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: bazarr-sync
  namespace: plex
  annotations:
    reloader.stakater.com/auto: "true"
spec:
  selector:
    matchLabels:
      app: bazarr-sync
  replicas: 1
  progressDeadlineSeconds: 600
  revisionHistoryLimit: 2
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: bazarr-sync
      annotations:
        deploy-date: "deploy-date-value"
    spec:
      containers:
        - name: bazarr-sync
          image: ghcr.io/ajmandourah/bazarr-sync:latest
          command: ["bazarr-sync"]
          args: ["sync", "shows"]
          volumeMounts:
            - mountPath: /usr/src/app/config.yaml
              subPath: config.yaml
              name: bazarr-sync-config
              readOnly: true
      volumes:
        - name: bazarr-sync-config
          configMap:
            name: bazarr-sync-config
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: bazarr-sync-config
  namespace: plex
data:
  config.yaml: |-
    #config file example, please don't use quotes
    ###########################
    #
    #Address: the address of your bazarr instance. this can be either an ip address or a url (if you reverse proxy bazarr),
    #this can also be bazarr's container name if you use docker, make sure bazarr-sync instance is in the same network as bazarr and >
    #docker network as name resolution won't happen there.
    Address: bazarr
    #
    #Port: bazarrs port. by default bazarr uses 6767. in case of reverse proxy, you can use 443 or 80 as per your configuration
    Port: 80
    #
    #protocol: this can be http or https
    Protocol: http
    #
    #ApiToken: you can get this from bazarr setting>general . no quotes needed.
    ApiToken: <redacted>

Can't reach bazarr when it is behind a reverse proxy

At home, I access bazarr through the url https://192.168.15.73/bazarr . In my config.yaml I have the Port empty, but bazarr-sync will add an : to the url.: https://192.168.15.73/bazarr:/api/system/status

If I put 443 there, it becomes: https://192.168.15.73/bazarr:443/api/system/status

logs not really working (maybe only on kubernetes?)

Hey so after running your script since some days on my cluster, I just wanna inform you that the log-output is not really working after a couple of hours.

So actually I have no idea where the progress is atm.

putty just outputs a whole lot of nothing:
image

rancher spits out the first couple of log msg's and doesn't really goes forward:
image

Error

ERROR

Had an error with a sync and then it keeps retrying and it messed up the terminal.

Animation

its still going I think

unable to install on debian 12

Hi, I'm unable to install this on debian 12.

bazarr-sync is never recognized as a command.

When I restart the shell, go is gone as well.

error, i can't run on docker

Hi, i try to run this but i get an error

Using config file: /usr/src/app/config.yaml
Connection Error: Get "https://192.168.1.200:6767/api/system/status": dial tcp 192.168.1.200:6767: i/o timeout
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x7ff618]

goroutine 1 [running]:
github.com/ajmandourah/bazarr-sync/internal/bazarr.HealthCheck({{0xc000130da0, 0xd}, {0xc000130e88, 0x4}, {0xc000130e00, 0x5}, {0xc000154880, 0x20}, {0xc000154920, 0x1b}, ...})
/usr/src/app/internal/bazarr/bazarr.go:156 +0x178
github.com/ajmandourah/bazarr-sync/internal/cli.init.func2(0xc0001b2300?, {0x8d9040?, 0x4?, 0x8d9044?})
/usr/src/app/internal/cli/shows.go:30 +0x7c
github.com/spf13/cobra.(*Command).execute(0xce7840, {0xd4f080, 0x0, 0x0})
/go/pkg/mod/github.com/spf13/[email protected]/command.go:987 +0xab1
github.com/spf13/cobra.(*Command).ExecuteC(0xce7560)
/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/ajmandourah/bazarr-sync/internal/cli.Execute()
/usr/src/app/internal/cli/root.go:34 +0x1a
main.main()
/usr/src/app/cmd/bazarr-sync/main.go:8 +0xf

please help me how to solve this ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.