about summary refs log tree commit diff stats
path: root/src/YtdlpWrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/YtdlpWrapper.cpp')
-rw-r--r--src/YtdlpWrapper.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/YtdlpWrapper.cpp b/src/YtdlpWrapper.cpp
index 9e27a1c..7368c14 100644
--- a/src/YtdlpWrapper.cpp
+++ b/src/YtdlpWrapper.cpp
@@ -1,4 +1,6 @@
 #include <string>
+#include <vector>
+#include <iostream>
 #include <pybind11/embed.h>
 #include <nlohmann/json.hpp>
 
@@ -30,3 +32,16 @@ json YtdlpWrapper::getJsonSearch(const std::string& searchTerm, int limit) {
     return json::parse(pyDictToJsonString(info));
 }
 
+std::vector<Video::video> YtdlpWrapper::searchVideos(const std::string& searchTerm, int limit) {
+
+    std::vector<Video::video> resp;
+
+    json info = getJsonSearch(searchTerm, limit);
+
+    for (json i: info["entries"]) {
+        std::cout << i["id"] << std::endl;
+    }
+
+    return resp;
+}
+
am <vc@akkartik.com> 2016-05-20 12:47:18 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2016-05-20 12:47:18 -0700 2986 - new example: the 8-queens problem' href='/akkartik/mu/commit/nqueens.mu?h=main&id=7890b8cef2c330ad69e2ce5861931ff2768d6194'>7890b8ce ^
9458918f ^
7890b8ce ^




192d59d3 ^
7890b8ce ^


192d59d3 ^
7890b8ce ^


192d59d3 ^
7890b8ce ^
9458918f ^
7890b8ce ^


9458918f ^
7890b8ce ^
93c9862f ^

7890b8ce ^
93c9862f ^
7890b8ce ^





9458918f ^
7890b8ce ^

9458918f ^
f116818c ^
9458918f ^
f116818c ^
7890b8ce ^

9458918f ^
7890b8ce ^

192d59d3 ^
7890b8ce ^


192d59d3 ^
9458918f ^
f116818c ^
7890b8ce ^


f116818c ^
7890b8ce ^

9458918f ^
7890b8ce ^

192d59d3 ^

7890b8ce ^


192d59d3 ^



7890b8ce ^

9458918f ^
f116818c ^
7890b8ce ^


f116818c ^
7890b8ce ^
760f683f ^




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99