summaryrefslogtreecommitdiffhomepage
path: root/downtube.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-06-17 14:32:31 +0200
committerRoland Reichwein <mail@reichwein.it>2020-06-17 14:32:31 +0200
commitdabe9c0c42b9ed7d3ef4fb0695cf40857a71eea4 (patch)
tree59606aa1985150acc347bcd44a8d4fce1acb4a7b /downtube.cpp
parent6de50984d920e93990ca4461a0f087f1c5c31f27 (diff)
downtube 1.1: bugfixes
Diffstat (limited to 'downtube.cpp')
-rw-r--r--downtube.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/downtube.cpp b/downtube.cpp
index 6e45764..7fd8b66 100644
--- a/downtube.cpp
+++ b/downtube.cpp
@@ -52,7 +52,7 @@ namespace {
const fs::path& getPath() const {return m_path;}
};
- std::regex re{"https?://(www\\.youtube\\.com/watch\\?v=|youtu\\.be/)[[:alnum:]-]+", std::regex::extended}; // www.youtube.com/watch?v=ItjMIxS3-rI or https://youtu.be/ItjMIxS3-rI
+ std::regex re{"https?://(www\\.youtube\\.com/watch\\?v=|youtu\\.be/)[[:alnum:]_&=-]+", std::regex::extended}; // www.youtube.com/watch?v=ItjMIxS3-rI or https://youtu.be/ItjMIxS3-rI
} // anonymous namespace
@@ -113,6 +113,11 @@ int main(void)
throw std::runtime_error("Bad URL");
}
+ // remove trailing "&..."
+ size_t and_pos {url.find('&')};
+ if (and_pos != std::string::npos)
+ url = url.substr(0, and_pos);
+
//FCGX_FPrintF(request.out, "command: %s\r\n", command.c_str());
TempDir tempDir;