aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Youtube.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/Youtube.cpp')
-rw-r--r--src/plugins/Youtube.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp
index 33e4cea..f7cfb09 100644
--- a/src/plugins/Youtube.cpp
+++ b/src/plugins/Youtube.cpp
@@ -18,7 +18,6 @@ extern "C" {
#include <json/writer.h>
#include <string.h>
#include <unistd.h>
-#include <fcntl.h>
namespace QuickMedia {
static const char *youtube_client_version = "x-youtube-client-version: 2.20210622.10.00";
@@ -191,27 +190,6 @@ namespace QuickMedia {
static std::string cpn;
- static bool generate_random_characters(char *buffer, int buffer_size, const char *alphabet, size_t alphabet_size) {
- int fd = open("/dev/urandom", O_RDONLY);
- if(fd == -1) {
- perror("/dev/urandom");
- return false;
- }
-
- if(read(fd, buffer, buffer_size) < buffer_size) {
- fprintf(stderr, "Failed to read %d bytes from /dev/urandom\n", buffer_size);
- close(fd);
- return false;
- }
-
- for(int i = 0; i < buffer_size; ++i) {
- unsigned char c = *(unsigned char*)&buffer[i];
- buffer[i] = alphabet[c % alphabet_size];
- }
- close(fd);
- return true;
- }
-
static std::string header_get_cookie(const char *str, size_t size, const char *cookies_key) {
const int cookie_key_len = strlen(cookies_key);
const char *cookie_p = (const char*)memmem(str, size, cookies_key, cookie_key_len);