« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crawlers.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/crawlers.js b/crawlers.js
index 8583d5c..fc1cccf 100644
--- a/crawlers.js
+++ b/crawlers.js
@@ -75,8 +75,8 @@ function crawlHTTP(absURL, opts = {}, internals = {}) {
           name = name.trim()
 
           let base
-          if (path.extname(absURL)) {
-            base = path.dirname(absURL) + '/'
+          if (path.extname(absURLObj.pathname)) {
+            base = absURLObj.origin + path.dirname(absURLObj.pathname) + '/'
           } else {
             base = absURL
           }