diff --git a/backend/app.js b/backend/app.js
index 6bd7774..3c1af08 100644
--- a/backend/app.js
+++ b/backend/app.js
@@ -2196,6 +2196,7 @@ app.post('/api/updateCategories', optionalJwt, async (req, res) => {
app.post('/api/subscribe', optionalJwt, async (req, res) => {
let name = req.body.name;
let url = req.body.url;
+ let maxQuality = req.body.maxQuality;
let timerange = req.body.timerange;
let streamingOnly = req.body.streamingOnly;
let audioOnly = req.body.audioOnly;
@@ -2205,6 +2206,7 @@ app.post('/api/subscribe', optionalJwt, async (req, res) => {
const new_sub = {
name: name,
url: url,
+ maxQuality: maxQuality,
id: uuid(),
streamingOnly: streamingOnly,
user_uid: user_uid,
diff --git a/backend/subscriptions.js b/backend/subscriptions.js
index 5eafc4e..4bd071b 100644
--- a/backend/subscriptions.js
+++ b/backend/subscriptions.js
@@ -114,7 +114,11 @@ async function getSubscriptionInfo(sub, user_uid = null) {
continue;
}
if (!sub.name) {
- sub.name = sub.isPlaylist ? output_json.playlist_title : output_json.uploader;
+ if (sub.isPlaylist) {
+ sub.name = output_json.playlist_title ? output_json.playlist_title : output_json.playlist;
+ } else {
+ sub.name = output_json.uploader;
+ }
// if it's now valid, update
if (sub.name) {
if (user_uid)
@@ -296,7 +300,8 @@ async function getVideosForSub(sub, user_uid = null) {
qualityPath.push('-x');
qualityPath.push('--audio-format', 'mp3');
} else {
- qualityPath = ['-f', 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4']
+ if (!sub.maxQuality || sub.maxQuality === 'best') qualityPath = ['-f', 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4'];
+ else qualityPath = ['-f', `bestvideo[height<=${sub.maxQuality}]+bestaudio/best[height<=${sub.maxQuality}]`, '--merge-output-format', 'mp4'];
}
downloadConfig.push(...qualityPath)
@@ -351,7 +356,7 @@ async function getVideosForSub(sub, user_uid = null) {
youtubedl.exec(sub.url, downloadConfig, {}, function(err, output) {
logger.verbose('Subscription: finished check for ' + sub.name);
if (err && !output) {
- logger.error(err.stderr);
+ logger.error(err.stderr ? err.stderr : err.message);
if (err.stderr.includes('This video is unavailable')) {
logger.info('An error was encountered with at least one video, backup method will be used.')
try {
diff --git a/src/app/dialogs/edit-subscription-dialog/edit-subscription-dialog.component.html b/src/app/dialogs/edit-subscription-dialog/edit-subscription-dialog.component.html
index 58a7670..00d5485 100644
--- a/src/app/dialogs/edit-subscription-dialog/edit-subscription-dialog.component.html
+++ b/src/app/dialogs/edit-subscription-dialog/edit-subscription-dialog.component.html
@@ -24,6 +24,13 @@