Compare commits
6 Commits
7fbac97e77
...
032d2997d5
Author | SHA1 | Date | |
---|---|---|---|
032d2997d5 | |||
91a0f23e32 | |||
84a39823f9 | |||
97f898a603 | |||
b652d20591 | |||
f2c7d70878 |
@ -1,8 +0,0 @@
|
|||||||
FROM python:3.7
|
|
||||||
|
|
||||||
RUN pip3 install flask requests
|
|
||||||
|
|
||||||
COPY . /app
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
CMD python3 app.py
|
|
@ -1,95 +0,0 @@
|
|||||||
from flask import Flask, render_template, request, redirect, jsonify, make_response
|
|
||||||
from os import listdir, getenv, path
|
|
||||||
from requests import post
|
|
||||||
from random import randint
|
|
||||||
|
|
||||||
JELLYFIN_DIRECTORY = getenv("JF_DIR")
|
|
||||||
FLAG_DIRECTORY = getenv("FLAG_DIR")
|
|
||||||
GOTIFY_URL = getenv("GOTIFY_URL")
|
|
||||||
BASE_URL = getenv("BASE_URL")
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
|
||||||
pending = {}
|
|
||||||
|
|
||||||
class PendingNaming:
|
|
||||||
def __init__(self, dl_path):
|
|
||||||
self.dl_path = dl_path
|
|
||||||
self.id = str(randint(100000, 999999))
|
|
||||||
|
|
||||||
def resolve(self):
|
|
||||||
pending.pop(self.id, None)
|
|
||||||
|
|
||||||
@app.route("/")
|
|
||||||
def index():
|
|
||||||
return render_template("index.html", pending=[pending[i] for i in pending], BASE_URL=BASE_URL)
|
|
||||||
|
|
||||||
@app.route("/<int:id>")
|
|
||||||
def index_with_id(id):
|
|
||||||
id = str(id)
|
|
||||||
if id in pending:
|
|
||||||
item = pending[id]
|
|
||||||
return render_template("resolve.html", item=item, BASE_URL=BASE_URL)
|
|
||||||
else:
|
|
||||||
return make_response("Pending item not found", 404)
|
|
||||||
|
|
||||||
@app.route("/addPending", methods=["POST", "GET"])
|
|
||||||
def add_pending():
|
|
||||||
dl_path = request.args.get("title")
|
|
||||||
if not dl_path:
|
|
||||||
dl_path = request.form.get("title")
|
|
||||||
if not dl_path:
|
|
||||||
return make_response("Title not provided", 400)
|
|
||||||
p = PendingNaming(dl_path)
|
|
||||||
pending[p.id] = p
|
|
||||||
|
|
||||||
url = "{}/{}".format(BASE_URL, p.id)
|
|
||||||
post(GOTIFY_URL, json={
|
|
||||||
"extras": {
|
|
||||||
"client::display": {
|
|
||||||
"contentType": "text/markdown"
|
|
||||||
},
|
|
||||||
"client::android": {
|
|
||||||
"autoLink": "web"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"title": "Intervention needed",
|
|
||||||
"message": "[{} could not be named]({})".format(dl_path, url),
|
|
||||||
"priority": 9
|
|
||||||
})
|
|
||||||
return str(p.id)
|
|
||||||
|
|
||||||
@app.route("/resolve", methods=["POST"])
|
|
||||||
def resolve():
|
|
||||||
id = request.form.get("id")
|
|
||||||
title = request.form.get("title")
|
|
||||||
season = request.form.get("season")
|
|
||||||
if not id in pending:
|
|
||||||
return make_response("Pending item not found", 404)
|
|
||||||
item = pending[id]
|
|
||||||
with open(path.join(FLAG_DIRECTORY, id), "w+") as f:
|
|
||||||
f.write("{0}|{0}|{1}".format(title, season))
|
|
||||||
item.resolve()
|
|
||||||
return redirect(BASE_URL)
|
|
||||||
|
|
||||||
@app.route("/delete/<int:id>", methods=["GET"])
|
|
||||||
def delete(id):
|
|
||||||
id = str(id)
|
|
||||||
if not id in pending:
|
|
||||||
return make_response("Pending item not found", 404)
|
|
||||||
item = pending[id]
|
|
||||||
with open(path.join(FLAG_DIRECTORY, id), "w+") as f:
|
|
||||||
f.write("delete")
|
|
||||||
item.resolve()
|
|
||||||
return redirect(BASE_URL)
|
|
||||||
|
|
||||||
@app.route("/autocomplete")
|
|
||||||
def autocomplete():
|
|
||||||
dirs = listdir(JELLYFIN_DIRECTORY)
|
|
||||||
query = request.args.get("term").lower()
|
|
||||||
if len(query) >= 2:
|
|
||||||
return jsonify([i for i in dirs if query in i.lower()])
|
|
||||||
return jsonify([])
|
|
||||||
|
|
||||||
|
|
||||||
if __name__=='__main__':
|
|
||||||
app.run("0.0.0.0", getenv("PORT"))
|
|
@ -1,22 +0,0 @@
|
|||||||
version: '3'
|
|
||||||
services:
|
|
||||||
anime-namer:
|
|
||||||
build: .
|
|
||||||
container_name: anime-namer
|
|
||||||
networks:
|
|
||||||
- anamer-network
|
|
||||||
ports:
|
|
||||||
- 9010:9010
|
|
||||||
environment:
|
|
||||||
- JF_DIR=THE_JELLYFIN_DIRECTORY
|
|
||||||
- FLAG_DIR=THE_FLAG_DIRECTORY
|
|
||||||
- BASE_URL=YOUR_BASE_URL
|
|
||||||
- GOTIFY_URL=YOUR_GOTIFY_URL
|
|
||||||
- PORT=9010
|
|
||||||
volumes:
|
|
||||||
- /mnt/Storage/Anime:/Anime
|
|
||||||
restart: unless-stopped
|
|
||||||
|
|
||||||
networks:
|
|
||||||
anamer-network:
|
|
||||||
driver: bridge
|
|
@ -1,83 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
||||||
<title>Anime namer</title>
|
|
||||||
<style>
|
|
||||||
* {
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
ul {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
ul li {
|
|
||||||
cursor: pointer;
|
|
||||||
position: relative;
|
|
||||||
padding: 12px 8px 12px 40px;
|
|
||||||
background: #eee;
|
|
||||||
font-size: 18px;
|
|
||||||
transition: 0.2s;
|
|
||||||
|
|
||||||
/* make the list items unselectable */
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
ul li:nth-child(odd) {
|
|
||||||
background: #f9f9f9;
|
|
||||||
}
|
|
||||||
ul li:hover {
|
|
||||||
background: #ddd;
|
|
||||||
}
|
|
||||||
ul li.checked {
|
|
||||||
background: #888;
|
|
||||||
color: #fff;
|
|
||||||
text-decoration: line-through;
|
|
||||||
}
|
|
||||||
ul li.checked::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
border-color: #fff;
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 0 2px 2px 0;
|
|
||||||
top: 10px;
|
|
||||||
left: 16px;
|
|
||||||
transform: rotate(45deg);
|
|
||||||
height: 15px;
|
|
||||||
width: 7px;
|
|
||||||
}
|
|
||||||
.close {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
padding: 12px 16px 12px 16px;
|
|
||||||
z-index: 99;
|
|
||||||
}
|
|
||||||
.close:hover {
|
|
||||||
background-color: #f44336;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<h1>Anime namer</h1>
|
|
||||||
<div>
|
|
||||||
<h2>Pending:</h2>
|
|
||||||
<ul>
|
|
||||||
{% for i in pending %}
|
|
||||||
<li>
|
|
||||||
<a href="{{ BASE_URL }}/{{ i.id }}">{{ i.dl_path }}</a>
|
|
||||||
<a href="{{ BASE_URL }}/delete/{{ i.id }}"><span class="close">X</span></a>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
@ -1,73 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
||||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
|
||||||
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
|
|
||||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
|
||||||
<title>Anime namer</title>
|
|
||||||
<style>
|
|
||||||
input[type=text],
|
|
||||||
input[type=number],
|
|
||||||
select,
|
|
||||||
textarea {
|
|
||||||
width: 100%;
|
|
||||||
padding: 12px;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 4px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin-top: 6px;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
resize: vertical
|
|
||||||
}
|
|
||||||
.button,
|
|
||||||
input[type=submit] {
|
|
||||||
background-color: #4CAF50;
|
|
||||||
color: white;
|
|
||||||
padding: 12px 20px;
|
|
||||||
border: none;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.button:hover,
|
|
||||||
input[type=submit]:hover {
|
|
||||||
background-color: #45a049;
|
|
||||||
}
|
|
||||||
.container {
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: #f2f2f2;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<h2>{{ item.dl_path }}</h2>
|
|
||||||
<form method="POST" action="{{ BASE_URL }}/resolve">
|
|
||||||
<input style="display:none;" type="text" name="id" value="{{ item.id }}">
|
|
||||||
<label for="titleInput">Title</label>
|
|
||||||
<input type="text" name="title" id="titleInput">
|
|
||||||
<label for="titleInput">Season</label>
|
|
||||||
<input type="number" name="season">
|
|
||||||
<input type="submit">
|
|
||||||
<a href="{{ BASE_URL }}/delete/{{ item.id }}"><button class="button" style="background-color: red;">Delete</button></a>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
$(function () {
|
|
||||||
$("#titleInput").autocomplete({
|
|
||||||
source: "{{ BASE_URL }}/autocomplete",
|
|
||||||
minLength: 2,
|
|
||||||
select: function (event, ui) {
|
|
||||||
$("#titleInput").val(ui.item.value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
@ -16,12 +16,10 @@ cd /scripts
|
|||||||
bash notif.sh "$name";
|
bash notif.sh "$name";
|
||||||
|
|
||||||
if [[ "$category" == "Anime" ]]; then
|
if [[ "$category" == "Anime" ]]; then
|
||||||
echo "Running jellyfin namer and subtitle converter";
|
echo "Running jellyfin namer";
|
||||||
if [[ -d "$root_path" ]]; then
|
if [[ -d "$root_path" ]]; then
|
||||||
bash subtitle-converter.sh "$root_path";
|
|
||||||
bash jellyfin-namer.sh "$root_path";
|
bash jellyfin-namer.sh "$root_path";
|
||||||
else
|
else
|
||||||
bash subtitle-converter.sh "$save_path";
|
|
||||||
bash jellyfin-namer.sh "$save_path";
|
bash jellyfin-namer.sh "$save_path";
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
74
anime_scripts/jellyfin-namer-new.sh
Executable file → Normal file
74
anime_scripts/jellyfin-namer-new.sh
Executable file → Normal file
@ -1,5 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
#Check if requests is installed, and if not install it
|
||||||
|
if [[ -f /tmp/request_install_lock ]]; then
|
||||||
|
while [[ -f /tmp/requests_install_lock ]]; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
else
|
||||||
|
python -c "import requests"
|
||||||
|
if [[ "$?" == "1" ]]; then
|
||||||
|
echo '' > /tmp/requests_install_lock
|
||||||
|
apt update
|
||||||
|
apt install python-requests
|
||||||
|
rm /tmp/requests_install_lock
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#Gets the last part of the current directory
|
#Gets the last part of the current directory
|
||||||
function get_bottom_dir() {
|
function get_bottom_dir() {
|
||||||
IFS='/';
|
IFS='/';
|
||||||
@ -16,53 +32,37 @@ function name_clean() {
|
|||||||
echo $(echo "$_out" | xargs);
|
echo $(echo "$_out" | xargs);
|
||||||
}
|
}
|
||||||
|
|
||||||
#Get series via seasons.py. Will fall-back to manual intervention if fail.
|
|
||||||
function get_series() {
|
function get_series() {
|
||||||
local sanitized_name=$(name_clean "$1");
|
local sanitized_name=$(name_clean "$1");
|
||||||
local output;
|
local output=$(python /scripts/seasons.py "$sanitized_name");
|
||||||
output=$(python3 /scripts/seasons.py "$sanitized_name"; exit "$?";);
|
if [[ "$?" != "0" ]]; then
|
||||||
if [[ "$?" -ne "0" ]]; then
|
return 1;
|
||||||
echo "seasons.py failed. Waiting for manual intevention.";
|
fi
|
||||||
local mi_id;
|
|
||||||
mi_id=$(curl --fail -F "dl_path=$sanitized_name" "$MI_URL"; exit "$?";);
|
|
||||||
if [[ "$?" -eq "0" ]]; then
|
|
||||||
while [[ ! -f "/Anime/flags/$mi_id" ]]; do
|
|
||||||
sleep 1;
|
|
||||||
done
|
|
||||||
output=$(cat "/Anime/flags/$mi_id");
|
|
||||||
rm "/Anime/flags/$mi_id";
|
|
||||||
if [[ "$output" -eq "delete" ]]; then
|
|
||||||
return 1;
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
return 1;
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
IFS="|";
|
IFS="|";
|
||||||
read -ra STR <<< "$output"
|
read -ra STR <<< "$output"
|
||||||
|
|
||||||
TITLE_ROMAJI="${STR[0]}";
|
TITLE_ROMAJI="${STR[0]}";
|
||||||
TITLE_ENGLISH="${STR[1]}";
|
TITLE_ENGLISH="${STR[1]}";
|
||||||
SEASON="${STR[2]}";
|
SEASON="${STR[2]}";
|
||||||
IFS=" ";
|
IFS=" ";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
cd "$1";
|
cd "$1";
|
||||||
|
|
||||||
bottom_dir=$(get_bottom_dir);
|
bottom_dir=$(get_bottom_dir);
|
||||||
cleaned_bottom_dir=$(name_clean "$bottom_dir");
|
cleaned_bottom_dir=$(name_clean "$bottom_dir");
|
||||||
get_series "$cleaned_bottom_dir";
|
get_series "$cleaned_bottom_dir";
|
||||||
if [[ "$?" -eq "0" ]]; then
|
if [[ "$?" == "0" ]]; then
|
||||||
if [[ -d "$JF_DIR/$TITLE_ROMAJI" ]]; then
|
if [[ -d "$JF_DIR/$TITLE_ROMAJI" ]]; then
|
||||||
cleaned_dir="$TITLE_ROMAJI/Season $SEASON";
|
cleaned_dir="$TITLE_ROMAJI/Season $SEASON";
|
||||||
elif [[ -d "$JF_DIR/$TITLE_ENGLISH" ]]; then
|
elif [[ -d "$JF_DIR/$TITLE_ENGLISH" ]]; then
|
||||||
cleaned_dir="$TITLE_ENGLISH/Season $SEASON";
|
cleaned_dir="$TITLE_ENGLISH/Season $SEASON";
|
||||||
else
|
else
|
||||||
cleaned_dir="$TITLE_ROMAJI/Season $SEASON";
|
cleaned_dir="$TITLE_ROMAJI/Season $SEASON";
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
cleaned_dir="$cleaned_bottom_dir";
|
cleaned_dir="$cleaned_bottom_dir";
|
||||||
fi
|
fi
|
||||||
mkdir -p "$JF_DIR/$cleaned_dir";
|
mkdir -p "$JF_DIR/$cleaned_dir";
|
||||||
|
|
||||||
|
42
anime_scripts/seasons.py
Executable file → Normal file
42
anime_scripts/seasons.py
Executable file → Normal file
@ -1,28 +1,20 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
from requests import post
|
from requests import post
|
||||||
from datetime import datetime
|
|
||||||
from sys import argv
|
from sys import argv
|
||||||
|
|
||||||
BASE_URL = "https://graphql.anilist.co"
|
BASE_URL = "https://graphql.anilist.co"
|
||||||
|
|
||||||
class BaseShowNotInList(Exception):
|
|
||||||
def __init__(self, items):
|
|
||||||
self.items = items
|
|
||||||
super().__init__("Base show not in sequel/prequel list.")
|
|
||||||
|
|
||||||
class SortableAnime:
|
class SortableAnime:
|
||||||
def __init__(self, id, year, month, day, reltype, title, frmt):
|
def __init__(self, id, year, reltype, title, frmt):
|
||||||
self.id = id
|
self.id = id
|
||||||
self.timestamp = datetime(year if year else 9999, month if month else 12, day if day else 31)
|
self.year = year if year else 9999
|
||||||
self.type = reltype
|
self.type = reltype
|
||||||
self.frmt = frmt
|
|
||||||
self.title = title
|
self.title = title
|
||||||
|
self.frmt = frmt
|
||||||
|
|
||||||
def dict(self):
|
def dict(self):
|
||||||
return {
|
return {
|
||||||
"id": self.id,
|
"id": self.id,
|
||||||
"timestamp": self.timestamp.strftime("%d-%m-%Y"),
|
"year": self.year,
|
||||||
"type": self.type,
|
"type": self.type,
|
||||||
"title": self.title,
|
"title": self.title,
|
||||||
"format": self.frmt
|
"format": self.frmt
|
||||||
@ -65,8 +57,6 @@ def get_show(id):
|
|||||||
}
|
}
|
||||||
startDate {
|
startDate {
|
||||||
year
|
year
|
||||||
month
|
|
||||||
day
|
|
||||||
}
|
}
|
||||||
format
|
format
|
||||||
relations {
|
relations {
|
||||||
@ -75,8 +65,6 @@ def get_show(id):
|
|||||||
format
|
format
|
||||||
startDate {
|
startDate {
|
||||||
year
|
year
|
||||||
month
|
|
||||||
day
|
|
||||||
}
|
}
|
||||||
title {
|
title {
|
||||||
english
|
english
|
||||||
@ -98,13 +86,13 @@ def get_show(id):
|
|||||||
|
|
||||||
def get_base_show(res):
|
def get_base_show(res):
|
||||||
base = res["data"]["Media"]
|
base = res["data"]["Media"]
|
||||||
return SortableAnime(base["id"], base["startDate"]["year"], base["startDate"]["month"], base["startDate"]["day"], "BASE", base["title"], base["format"])
|
return SortableAnime(base["id"], base["startDate"]["year"], "BASE", base["title"], base["format"])
|
||||||
|
|
||||||
def process_shows(res):
|
def process_shows(res):
|
||||||
ls = []
|
ls = []
|
||||||
ls.append(get_base_show(res))
|
ls.append(get_base_show(res))
|
||||||
for i,v in enumerate(res["data"]["Media"]["relations"]["nodes"]):
|
for i,v in enumerate(res["data"]["Media"]["relations"]["nodes"]):
|
||||||
ls.append(SortableAnime(v["id"], v["startDate"]["year"], v["startDate"]["month"], v["startDate"]["day"], res["data"]["Media"]["relations"]["edges"][i]["relationType"], v["title"], v["format"]))
|
ls.append(SortableAnime(v["id"], v["startDate"]["year"], res["data"]["Media"]["relations"]["edges"][i]["relationType"], v["title"], v["format"]))
|
||||||
pass
|
pass
|
||||||
return ls
|
return ls
|
||||||
|
|
||||||
@ -117,7 +105,6 @@ def main(query):
|
|||||||
|
|
||||||
if "PREQUEL" not in [i.type for i in items]:
|
if "PREQUEL" not in [i.type for i in items]:
|
||||||
season = 1
|
season = 1
|
||||||
final_items = items
|
|
||||||
else:
|
else:
|
||||||
ignore = []
|
ignore = []
|
||||||
while True:
|
while True:
|
||||||
@ -130,19 +117,10 @@ def main(query):
|
|||||||
f = True
|
f = True
|
||||||
if not f:
|
if not f:
|
||||||
break
|
break
|
||||||
final_items = [i for i in items if i.frmt == "TV" and (i.type == "PREQUEL" or i.type == "SEQUEL" or i.type == "BASE")]
|
items = [i for i in items if i.frmt == "TV" and (i.type == "PREQUEL" or i.type == "SEQUEL" or i.type == "BASE")]
|
||||||
if not base_show in final_items:
|
items.sort(key=lambda i: i.year)
|
||||||
final_items = [i for i in items if (i.type == "PREQUEL" or i.type == "SEQUEL" or i.type == "BASE")]
|
season = items.index(base_show)+1
|
||||||
final_items.sort(key=lambda i: i.timestamp)
|
return season, base_show, items
|
||||||
if base_show in final_items:
|
|
||||||
season = final_items.index(base_show)
|
|
||||||
if season:
|
|
||||||
season += 1
|
|
||||||
else:
|
|
||||||
raise Exception("Cannot determine season")
|
|
||||||
else:
|
|
||||||
raise BaseShowNotInList(final_items)
|
|
||||||
return season, base_show, final_items
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
season, show, items = main(argv[1])
|
season, show, items = main(argv[1])
|
||||||
|
@ -4,7 +4,7 @@ function convert() {
|
|||||||
res=$(ffprobe -v error -show_entries stream=codec_type,codec_name -of compact "$1" | grep -s "subtitle");
|
res=$(ffprobe -v error -show_entries stream=codec_type,codec_name -of compact "$1" | grep -s "subtitle");
|
||||||
if [[ "$res" == *"ass"* ]]; then
|
if [[ "$res" == *"ass"* ]]; then
|
||||||
echo "Converting $1";
|
echo "Converting $1";
|
||||||
ffmpeg -n -i "$1" -c:s srt "${i%.$ext}.srt" > /dev/null
|
ffmpeg -n -i "$1" -c:s srt "${i%.$ext}.srt" > /dev/null 2&> /dev/null;
|
||||||
else
|
else
|
||||||
echo "$1 not ASS. Skipping";
|
echo "$1 not ASS. Skipping";
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user