-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathripper.cpp
More file actions
79 lines (46 loc) · 1.31 KB
/
ripper.cpp
File metadata and controls
79 lines (46 loc) · 1.31 KB
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
#include <iostream>
#include <vector>
#include <thread>
#include "ripper.h"
using namespace std;
string fnumstr4(int num){
if(num < 10){
return "000" + to_string(num);
} else if(num < 100){
return "00" + to_string(num);
} else if(num < 1000){
return "0" + to_string(num);
} else {
return to_string(num);
}
}
vector<vector<string>> mdiv(vector<string> in, int x){
vector<vector<string>> out;
int indx = 0;
int indmax = in.size();
// init. out with x vectors
for(int i = 0; i < x; i++) out.push_back(vector<string>());
// push in elements to x number out vectors sequentially one to each out vector
// push first element to out[0] the next to out[1]
for(int i = 0; i < indmax; i++){
for(int j = 0; j < x; j++){
out[j].push_back(in[indx]);
indx++;
if( indx >= (indmax) ) break;
}
if( indx >= (indmax) ) break;
}
return out;
}
void seqdl(vector<string> vurl, vector<string> vfname, string dlpath){
if(dlpath.back() != '/') dlpath.push_back('/');
string temp;
for(int i = 0; i < vurl.size(); i++){
temp = "curl --create-dirs " + vurl.at(i) + " -o " + dlpath + vfname.at(i);
system(temp.c_str());
}
}
void multidl(vector<vector<string>> inurl, vector<vector<string>> inname, string dlpath){
if(dlpath.back() != '/') dlpath.push_back('/');
vector<thread> tvec;
}