about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/subscribe/mod.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/subscribe/mod.rs b/src/subscribe/mod.rs
index 1796fb4..1cb3092 100644
--- a/src/subscribe/mod.rs
+++ b/src/subscribe/mod.rs
@@ -70,7 +70,10 @@ pub async fn import<W: AsyncBufRead + AsyncBufReadExt + Unpin>(
 pub async fn subscribe(app: &App, name: Option<String>, url: Url) -> Result<()> {
     if !(url.as_str().ends_with("videos")
         || url.as_str().ends_with("streams")
-        || url.as_str().ends_with("shorts"))
+        || url.as_str().ends_with("shorts")
+        || url.as_str().ends_with("videos/")
+        || url.as_str().ends_with("streams/")
+        || url.as_str().ends_with("shorts/"))
         && url.as_str().contains("youtube.com")
     {
         warn!("Your youtbe url does not seem like it actually tracks a channels playlist (videos, streams, shorts). Adding subscriptions for each of them...");
@@ -135,11 +138,11 @@ pub async fn subscribe(app: &App, name: Option<String>, url: Url) -> Result<()>
 }
 
 async fn actual_subscribe(app: &App, name: Option<String>, url: Url) -> Result<()> {
-    let name = if let Some(name) = name {
-        if !check_url(&url).await? {
-            bail!("The url ('{}') does not represent a playlist!", &url)
-        };
+    if !check_url(&url).await? {
+        bail!("The url ('{}') does not represent a playlist!", &url)
+    };
 
+    let name = if let Some(name) = name {
         name
     } else {
         let yt_opts = match json!( {