Skip to content

Commit

Permalink
Fixed info URL. Works again
Browse files Browse the repository at this point in the history
  • Loading branch information
Camilo Hernández committed Jul 20, 2021
1 parent 5a53b1c commit 08e7dbb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Project exclude paths
/cmake-build-debug/CMakeFiles/
/cmake-build-release/CMakeFiles/
cmake-build-debug
cmake-build-release
.idea
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.18)
cmake_minimum_required(VERSION 3.17)
project(hyitt)

set(CMAKE_CXX_STANDARD 14)
Expand Down
11 changes: 10 additions & 1 deletion hyitt/video/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,16 @@ bool Video::isSet() const {
}

std::map<std::string, std::string> Video::getInfo() {
const std::string URL = "https://www.youtube.com/get_video_info?video_id=" + getId();
std::string watchUrl = "https://youtube.com/watch?v=" + getId();
char *eUrl = curl_easy_escape(curl_easy_init(), watchUrl.c_str(), watchUrl.size());
const std::string URL = "https://www.youtube.com/get_video_info"
"?video_id=" + getId() +
"&ps=default"
"&eurl=" + eUrl +
"&hl=en_US"
"&html5=1"
"&c=TVHTML5"
"&cver=7.20201028";

cpr::Session session;
session.SetUrl(URL);
Expand Down

0 comments on commit 08e7dbb

Please sign in to comment.