删除RemoteName字段

main v1.15.19
orestonce 2022-10-06 09:57:34 +08:00
parent eee8bd49cc
commit 6ff8da018e
4 changed files with 248 additions and 255 deletions

View File

@ -110,7 +110,6 @@ func init() {
downloadCmd.Flags().BoolVarP(&gRunReq.Insecure, "Insecure", "", false, "是否允许不安全的请求") downloadCmd.Flags().BoolVarP(&gRunReq.Insecure, "Insecure", "", false, "是否允许不安全的请求")
downloadCmd.Flags().StringVarP(&gRunReq.SaveDir, "SaveDir", "d", "", "文件保存路径(默认为当前路径)") downloadCmd.Flags().StringVarP(&gRunReq.SaveDir, "SaveDir", "d", "", "文件保存路径(默认为当前路径)")
downloadCmd.Flags().StringVarP(&gRunReq.FileName, "FileName", "f", "", "文件名") downloadCmd.Flags().StringVarP(&gRunReq.FileName, "FileName", "f", "", "文件名")
downloadCmd.Flags().BoolVarP(&gRunReq.RemoteName, "RemoteFileName", "F", false, "尝试自动获取文件名")
downloadCmd.Flags().IntVarP(&gRunReq.SkipTsCountFromHead, "SkipTsCountFromHead", "", 0, "跳过前面几个ts") downloadCmd.Flags().IntVarP(&gRunReq.SkipTsCountFromHead, "SkipTsCountFromHead", "", 0, "跳过前面几个ts")
downloadCmd.Flags().StringVarP(&gRunReq.SetProxy, "SetProxy", "", "", "代理设置, http://127.0.0.1:8080 socks5://127.0.0.1:1089") downloadCmd.Flags().StringVarP(&gRunReq.SetProxy, "SetProxy", "", "", "代理设置, http://127.0.0.1:8080 socks5://127.0.0.1:1089")
downloadCmd.Flags().BoolVarP(&gRunReq.SkipRemoveTs, "SkipRemoveTs", "", false, "不删除下载的ts文件") downloadCmd.Flags().BoolVarP(&gRunReq.SkipRemoveTs, "SkipRemoveTs", "", false, "不删除下载的ts文件")

View File

@ -86,7 +86,6 @@ type RunDownload_Req struct {
Insecure bool // "是否允许不安全的请求(默认为false)" Insecure bool // "是否允许不安全的请求(默认为false)"
SaveDir string // "文件保存路径(默认为当前路径)" SaveDir string // "文件保存路径(默认为当前路径)"
FileName string // 文件名 FileName string // 文件名
RemoteName bool // 尝试自动获取文件名
SkipTsCountFromHead int // 跳过前面几个ts SkipTsCountFromHead int // 跳过前面几个ts
SetProxy string SetProxy string
HeaderMap map[string][]string HeaderMap map[string][]string
@ -118,11 +117,8 @@ func (this *downloadEnv) RunDownload(req RunDownload_Req) (resp RunDownload_Resp
return resp return resp
} }
} }
if req.RemoteName && req.FileName == "" {
req.FileName = GetFileNameFromUrl(req.M3u8Url)
}
if req.FileName == "" { if req.FileName == "" {
req.FileName = "all" req.FileName = GetFileNameFromUrl(req.M3u8Url)
} }
if req.SkipTsCountFromHead < 0 { if req.SkipTsCountFromHead < 0 {
req.SkipTsCountFromHead = 0 req.SkipTsCountFromHead = 0
@ -683,6 +679,9 @@ func GetFileNameFromUrl(u string) string {
return "all" return "all"
} }
name := path.Base(urlObj.Path) name := path.Base(urlObj.Path)
if name == "" {
return "all"
}
ext := path.Ext(name) ext := path.Ext(name)
if len(name) > len(ext) { if len(name) > len(ext) {
return strings.TrimSuffix(name, ext) return strings.TrimSuffix(name, ext)

View File

@ -86,92 +86,91 @@ RunDownload_Resp RunDownload(RunDownload_Req in0){
std::string in; std::string in;
{ {
{ {
uint32_t tmp36 = in0.M3u8Url.length(); uint32_t tmp35 = in0.M3u8Url.length();
char tmp37[4]; char tmp36[4];
tmp37[0] = (uint32_t(tmp36) >> 24) & 0xFF; tmp36[0] = (uint32_t(tmp35) >> 24) & 0xFF;
tmp37[1] = (uint32_t(tmp36) >> 16) & 0xFF; tmp36[1] = (uint32_t(tmp35) >> 16) & 0xFF;
tmp37[2] = (uint32_t(tmp36) >> 8) & 0xFF; tmp36[2] = (uint32_t(tmp35) >> 8) & 0xFF;
tmp37[3] = (uint32_t(tmp36) >> 0) & 0xFF; tmp36[3] = (uint32_t(tmp35) >> 0) & 0xFF;
in.append(tmp37, 4); in.append(tmp36, 4);
in.append(in0.M3u8Url); in.append(in0.M3u8Url);
} }
in.append((char*)(&in0.Insecure), 1); in.append((char*)(&in0.Insecure), 1);
{ {
uint32_t tmp38 = in0.SaveDir.length(); uint32_t tmp37 = in0.SaveDir.length();
char tmp39[4]; char tmp38[4];
tmp39[0] = (uint32_t(tmp38) >> 24) & 0xFF; tmp38[0] = (uint32_t(tmp37) >> 24) & 0xFF;
tmp39[1] = (uint32_t(tmp38) >> 16) & 0xFF; tmp38[1] = (uint32_t(tmp37) >> 16) & 0xFF;
tmp39[2] = (uint32_t(tmp38) >> 8) & 0xFF; tmp38[2] = (uint32_t(tmp37) >> 8) & 0xFF;
tmp39[3] = (uint32_t(tmp38) >> 0) & 0xFF; tmp38[3] = (uint32_t(tmp37) >> 0) & 0xFF;
in.append(tmp39, 4); in.append(tmp38, 4);
in.append(in0.SaveDir); in.append(in0.SaveDir);
} }
{ {
uint32_t tmp40 = in0.FileName.length(); uint32_t tmp39 = in0.FileName.length();
char tmp41[4]; char tmp40[4];
tmp41[0] = (uint32_t(tmp40) >> 24) & 0xFF; tmp40[0] = (uint32_t(tmp39) >> 24) & 0xFF;
tmp41[1] = (uint32_t(tmp40) >> 16) & 0xFF; tmp40[1] = (uint32_t(tmp39) >> 16) & 0xFF;
tmp41[2] = (uint32_t(tmp40) >> 8) & 0xFF; tmp40[2] = (uint32_t(tmp39) >> 8) & 0xFF;
tmp41[3] = (uint32_t(tmp40) >> 0) & 0xFF; tmp40[3] = (uint32_t(tmp39) >> 0) & 0xFF;
in.append(tmp41, 4); in.append(tmp40, 4);
in.append(in0.FileName); in.append(in0.FileName);
} }
in.append((char*)(&in0.RemoteName), 1);
{ {
char tmp42[4]; char tmp41[4];
tmp42[0] = (uint32_t(in0.SkipTsCountFromHead) >> 24) & 0xFF; tmp41[0] = (uint32_t(in0.SkipTsCountFromHead) >> 24) & 0xFF;
tmp42[1] = (uint32_t(in0.SkipTsCountFromHead) >> 16) & 0xFF; tmp41[1] = (uint32_t(in0.SkipTsCountFromHead) >> 16) & 0xFF;
tmp42[2] = (uint32_t(in0.SkipTsCountFromHead) >> 8) & 0xFF; tmp41[2] = (uint32_t(in0.SkipTsCountFromHead) >> 8) & 0xFF;
tmp42[3] = (uint32_t(in0.SkipTsCountFromHead) >> 0) & 0xFF; tmp41[3] = (uint32_t(in0.SkipTsCountFromHead) >> 0) & 0xFF;
in.append(tmp42, 4); in.append(tmp41, 4);
} }
{ {
uint32_t tmp43 = in0.SetProxy.length(); uint32_t tmp42 = in0.SetProxy.length();
char tmp44[4]; char tmp43[4];
tmp44[0] = (uint32_t(tmp43) >> 24) & 0xFF; tmp43[0] = (uint32_t(tmp42) >> 24) & 0xFF;
tmp44[1] = (uint32_t(tmp43) >> 16) & 0xFF; tmp43[1] = (uint32_t(tmp42) >> 16) & 0xFF;
tmp44[2] = (uint32_t(tmp43) >> 8) & 0xFF; tmp43[2] = (uint32_t(tmp42) >> 8) & 0xFF;
tmp44[3] = (uint32_t(tmp43) >> 0) & 0xFF; tmp43[3] = (uint32_t(tmp42) >> 0) & 0xFF;
in.append(tmp44, 4); in.append(tmp43, 4);
in.append(in0.SetProxy); in.append(in0.SetProxy);
} }
{ {
uint32_t tmp45 = in0.HeaderMap.size(); uint32_t tmp44 = in0.HeaderMap.size();
char tmp46[4]; char tmp45[4];
tmp46[0] = (uint32_t(tmp45) >> 24) & 0xFF; tmp45[0] = (uint32_t(tmp44) >> 24) & 0xFF;
tmp46[1] = (uint32_t(tmp45) >> 16) & 0xFF; tmp45[1] = (uint32_t(tmp44) >> 16) & 0xFF;
tmp46[2] = (uint32_t(tmp45) >> 8) & 0xFF; tmp45[2] = (uint32_t(tmp44) >> 8) & 0xFF;
tmp46[3] = (uint32_t(tmp45) >> 0) & 0xFF; tmp45[3] = (uint32_t(tmp44) >> 0) & 0xFF;
in.append(tmp46, 4); in.append(tmp45, 4);
for(std::map<std::string, std::vector<std::string>>::iterator tmp47 = in0.HeaderMap.begin(); tmp47 != in0.HeaderMap.end(); ++tmp47) { for(std::map<std::string, std::vector<std::string>>::iterator tmp46 = in0.HeaderMap.begin(); tmp46 != in0.HeaderMap.end(); ++tmp46) {
{ {
uint32_t tmp48 = tmp47->first.length(); uint32_t tmp47 = tmp46->first.length();
char tmp49[4]; char tmp48[4];
tmp49[0] = (uint32_t(tmp48) >> 24) & 0xFF; tmp48[0] = (uint32_t(tmp47) >> 24) & 0xFF;
tmp49[1] = (uint32_t(tmp48) >> 16) & 0xFF; tmp48[1] = (uint32_t(tmp47) >> 16) & 0xFF;
tmp49[2] = (uint32_t(tmp48) >> 8) & 0xFF; tmp48[2] = (uint32_t(tmp47) >> 8) & 0xFF;
tmp49[3] = (uint32_t(tmp48) >> 0) & 0xFF; tmp48[3] = (uint32_t(tmp47) >> 0) & 0xFF;
in.append(tmp49, 4); in.append(tmp48, 4);
in.append(tmp47->first); in.append(tmp46->first);
} }
{ {
uint32_t tmp50 = tmp47->second.size(); uint32_t tmp49 = tmp46->second.size();
char tmp51[4]; char tmp50[4];
tmp51[0] = (uint32_t(tmp50) >> 24) & 0xFF; tmp50[0] = (uint32_t(tmp49) >> 24) & 0xFF;
tmp51[1] = (uint32_t(tmp50) >> 16) & 0xFF; tmp50[1] = (uint32_t(tmp49) >> 16) & 0xFF;
tmp51[2] = (uint32_t(tmp50) >> 8) & 0xFF; tmp50[2] = (uint32_t(tmp49) >> 8) & 0xFF;
tmp51[3] = (uint32_t(tmp50) >> 0) & 0xFF; tmp50[3] = (uint32_t(tmp49) >> 0) & 0xFF;
in.append(tmp51, 4); in.append(tmp50, 4);
for (uint32_t tmp52=0; tmp52 < tmp50; ++tmp52) { for (uint32_t tmp51=0; tmp51 < tmp49; ++tmp51) {
{ {
uint32_t tmp53 = tmp47->second[tmp52].length(); uint32_t tmp52 = tmp46->second[tmp51].length();
char tmp54[4]; char tmp53[4];
tmp54[0] = (uint32_t(tmp53) >> 24) & 0xFF; tmp53[0] = (uint32_t(tmp52) >> 24) & 0xFF;
tmp54[1] = (uint32_t(tmp53) >> 16) & 0xFF; tmp53[1] = (uint32_t(tmp52) >> 16) & 0xFF;
tmp54[2] = (uint32_t(tmp53) >> 8) & 0xFF; tmp53[2] = (uint32_t(tmp52) >> 8) & 0xFF;
tmp54[3] = (uint32_t(tmp53) >> 0) & 0xFF; tmp53[3] = (uint32_t(tmp52) >> 0) & 0xFF;
in.append(tmp54, 4); in.append(tmp53, 4);
in.append(tmp47->second[tmp52]); in.append(tmp46->second[tmp51]);
} }
} }
} }
@ -187,30 +186,30 @@ RunDownload_Resp RunDownload(RunDownload_Req in0){
int outIdx = 0; int outIdx = 0;
{ {
{ {
uint32_t tmp55 = 0; uint32_t tmp54 = 0;
uint32_t tmp56 = uint32_t(uint8_t(out[outIdx+0]) << 24); uint32_t tmp55 = uint32_t(uint8_t(out[outIdx+0]) << 24);
uint32_t tmp57 = uint32_t(uint8_t(out[outIdx+1]) << 16); uint32_t tmp56 = uint32_t(uint8_t(out[outIdx+1]) << 16);
uint32_t tmp58 = uint32_t(uint8_t(out[outIdx+2]) << 8); uint32_t tmp57 = uint32_t(uint8_t(out[outIdx+2]) << 8);
uint32_t tmp59 = uint32_t(uint8_t(out[outIdx+3]) << 0); uint32_t tmp58 = uint32_t(uint8_t(out[outIdx+3]) << 0);
tmp55 = tmp56 | tmp57 | tmp58 | tmp59; tmp54 = tmp55 | tmp56 | tmp57 | tmp58;
outIdx+=4; outIdx+=4;
retValue.ErrMsg = std::string(out+outIdx, out+outIdx+tmp55); retValue.ErrMsg = std::string(out+outIdx, out+outIdx+tmp54);
outIdx+=tmp55; outIdx+=tmp54;
} }
retValue.IsSkipped = (bool) out[outIdx]; retValue.IsSkipped = (bool) out[outIdx];
outIdx++; outIdx++;
retValue.IsCancel = (bool) out[outIdx]; retValue.IsCancel = (bool) out[outIdx];
outIdx++; outIdx++;
{ {
uint32_t tmp60 = 0; uint32_t tmp59 = 0;
uint32_t tmp61 = uint32_t(uint8_t(out[outIdx+0]) << 24); uint32_t tmp60 = uint32_t(uint8_t(out[outIdx+0]) << 24);
uint32_t tmp62 = uint32_t(uint8_t(out[outIdx+1]) << 16); uint32_t tmp61 = uint32_t(uint8_t(out[outIdx+1]) << 16);
uint32_t tmp63 = uint32_t(uint8_t(out[outIdx+2]) << 8); uint32_t tmp62 = uint32_t(uint8_t(out[outIdx+2]) << 8);
uint32_t tmp64 = uint32_t(uint8_t(out[outIdx+3]) << 0); uint32_t tmp63 = uint32_t(uint8_t(out[outIdx+3]) << 0);
tmp60 = tmp61 | tmp62 | tmp63 | tmp64; tmp59 = tmp60 | tmp61 | tmp62 | tmp63;
outIdx+=4; outIdx+=4;
retValue.SaveFileTo = std::string(out+outIdx, out+outIdx+tmp60); retValue.SaveFileTo = std::string(out+outIdx, out+outIdx+tmp59);
outIdx+=tmp60; outIdx+=tmp59;
} }
} }
if (out != NULL) { if (out != NULL) {
@ -301,13 +300,13 @@ std::string GetWd(){
ParseCurl_Resp ParseCurlStr(std::string in0){ ParseCurl_Resp ParseCurlStr(std::string in0){
std::string in; std::string in;
{ {
uint32_t tmp21 = in0.length(); uint32_t tmp20 = in0.length();
char tmp22[4]; char tmp21[4];
tmp22[0] = (uint32_t(tmp21) >> 24) & 0xFF; tmp21[0] = (uint32_t(tmp20) >> 24) & 0xFF;
tmp22[1] = (uint32_t(tmp21) >> 16) & 0xFF; tmp21[1] = (uint32_t(tmp20) >> 16) & 0xFF;
tmp22[2] = (uint32_t(tmp21) >> 8) & 0xFF; tmp21[2] = (uint32_t(tmp20) >> 8) & 0xFF;
tmp22[3] = (uint32_t(tmp21) >> 0) & 0xFF; tmp21[3] = (uint32_t(tmp20) >> 0) & 0xFF;
in.append(tmp22, 4); in.append(tmp21, 4);
in.append(in0); in.append(in0);
} }
char *out = NULL; char *out = NULL;
@ -317,120 +316,118 @@ ParseCurl_Resp ParseCurlStr(std::string in0){
int outIdx = 0; int outIdx = 0;
{ {
{ {
uint32_t tmp23 = 0; uint32_t tmp22 = 0;
uint32_t tmp24 = uint32_t(uint8_t(out[outIdx+0]) << 24); uint32_t tmp23 = uint32_t(uint8_t(out[outIdx+0]) << 24);
uint32_t tmp25 = uint32_t(uint8_t(out[outIdx+1]) << 16); uint32_t tmp24 = uint32_t(uint8_t(out[outIdx+1]) << 16);
uint32_t tmp26 = uint32_t(uint8_t(out[outIdx+2]) << 8); uint32_t tmp25 = uint32_t(uint8_t(out[outIdx+2]) << 8);
uint32_t tmp27 = uint32_t(uint8_t(out[outIdx+3]) << 0); uint32_t tmp26 = uint32_t(uint8_t(out[outIdx+3]) << 0);
tmp23 = tmp24 | tmp25 | tmp26 | tmp27; tmp22 = tmp23 | tmp24 | tmp25 | tmp26;
outIdx+=4; outIdx+=4;
retValue.ErrMsg = std::string(out+outIdx, out+outIdx+tmp23); retValue.ErrMsg = std::string(out+outIdx, out+outIdx+tmp22);
outIdx+=tmp23; outIdx+=tmp22;
} }
{ {
{ {
uint32_t tmp28 = 0; uint32_t tmp27 = 0;
uint32_t tmp29 = uint32_t(uint8_t(out[outIdx+0]) << 24); uint32_t tmp28 = uint32_t(uint8_t(out[outIdx+0]) << 24);
uint32_t tmp30 = uint32_t(uint8_t(out[outIdx+1]) << 16); uint32_t tmp29 = uint32_t(uint8_t(out[outIdx+1]) << 16);
uint32_t tmp31 = uint32_t(uint8_t(out[outIdx+2]) << 8); uint32_t tmp30 = uint32_t(uint8_t(out[outIdx+2]) << 8);
uint32_t tmp32 = uint32_t(uint8_t(out[outIdx+3]) << 0); uint32_t tmp31 = uint32_t(uint8_t(out[outIdx+3]) << 0);
tmp28 = tmp29 | tmp30 | tmp31 | tmp32; tmp27 = tmp28 | tmp29 | tmp30 | tmp31;
outIdx+=4; outIdx+=4;
retValue.DownloadReq.M3u8Url = std::string(out+outIdx, out+outIdx+tmp28); retValue.DownloadReq.M3u8Url = std::string(out+outIdx, out+outIdx+tmp27);
outIdx+=tmp28; outIdx+=tmp27;
} }
retValue.DownloadReq.Insecure = (bool) out[outIdx]; retValue.DownloadReq.Insecure = (bool) out[outIdx];
outIdx++; outIdx++;
{ {
uint32_t tmp33 = 0; uint32_t tmp32 = 0;
uint32_t tmp34 = uint32_t(uint8_t(out[outIdx+0]) << 24); uint32_t tmp33 = uint32_t(uint8_t(out[outIdx+0]) << 24);
uint32_t tmp35 = uint32_t(uint8_t(out[outIdx+1]) << 16); uint32_t tmp34 = uint32_t(uint8_t(out[outIdx+1]) << 16);
uint32_t tmp36 = uint32_t(uint8_t(out[outIdx+2]) << 8); uint32_t tmp35 = uint32_t(uint8_t(out[outIdx+2]) << 8);
uint32_t tmp37 = uint32_t(uint8_t(out[outIdx+3]) << 0); uint32_t tmp36 = uint32_t(uint8_t(out[outIdx+3]) << 0);
tmp33 = tmp34 | tmp35 | tmp36 | tmp37; tmp32 = tmp33 | tmp34 | tmp35 | tmp36;
outIdx+=4; outIdx+=4;
retValue.DownloadReq.SaveDir = std::string(out+outIdx, out+outIdx+tmp33); retValue.DownloadReq.SaveDir = std::string(out+outIdx, out+outIdx+tmp32);
outIdx+=tmp33; outIdx+=tmp32;
} }
{ {
uint32_t tmp38 = 0; uint32_t tmp37 = 0;
uint32_t tmp39 = uint32_t(uint8_t(out[outIdx+0]) << 24); uint32_t tmp38 = uint32_t(uint8_t(out[outIdx+0]) << 24);
uint32_t tmp40 = uint32_t(uint8_t(out[outIdx+1]) << 16); uint32_t tmp39 = uint32_t(uint8_t(out[outIdx+1]) << 16);
uint32_t tmp41 = uint32_t(uint8_t(out[outIdx+2]) << 8); uint32_t tmp40 = uint32_t(uint8_t(out[outIdx+2]) << 8);
uint32_t tmp42 = uint32_t(uint8_t(out[outIdx+3]) << 0); uint32_t tmp41 = uint32_t(uint8_t(out[outIdx+3]) << 0);
tmp38 = tmp39 | tmp40 | tmp41 | tmp42; tmp37 = tmp38 | tmp39 | tmp40 | tmp41;
outIdx+=4; outIdx+=4;
retValue.DownloadReq.FileName = std::string(out+outIdx, out+outIdx+tmp38); retValue.DownloadReq.FileName = std::string(out+outIdx, out+outIdx+tmp37);
outIdx+=tmp38; outIdx+=tmp37;
} }
retValue.DownloadReq.RemoteName = (bool) out[outIdx];
outIdx++;
{ {
uint32_t tmp43 = uint32_t(uint8_t(out[outIdx+0]) << 24); uint32_t tmp42 = uint32_t(uint8_t(out[outIdx+0]) << 24);
uint32_t tmp44 = uint32_t(uint8_t(out[outIdx+1]) << 16); uint32_t tmp43 = uint32_t(uint8_t(out[outIdx+1]) << 16);
uint32_t tmp45 = uint32_t(uint8_t(out[outIdx+2]) << 8); uint32_t tmp44 = uint32_t(uint8_t(out[outIdx+2]) << 8);
uint32_t tmp46 = uint32_t(uint8_t(out[outIdx+3]) << 0); uint32_t tmp45 = uint32_t(uint8_t(out[outIdx+3]) << 0);
retValue.DownloadReq.SkipTsCountFromHead = tmp43 | tmp44 | tmp45 | tmp46; retValue.DownloadReq.SkipTsCountFromHead = tmp42 | tmp43 | tmp44 | tmp45;
outIdx+=4; outIdx+=4;
} }
{ {
uint32_t tmp47 = 0; uint32_t tmp46 = 0;
uint32_t tmp48 = uint32_t(uint8_t(out[outIdx+0]) << 24); uint32_t tmp47 = uint32_t(uint8_t(out[outIdx+0]) << 24);
uint32_t tmp49 = uint32_t(uint8_t(out[outIdx+1]) << 16); uint32_t tmp48 = uint32_t(uint8_t(out[outIdx+1]) << 16);
uint32_t tmp50 = uint32_t(uint8_t(out[outIdx+2]) << 8); uint32_t tmp49 = uint32_t(uint8_t(out[outIdx+2]) << 8);
uint32_t tmp51 = uint32_t(uint8_t(out[outIdx+3]) << 0); uint32_t tmp50 = uint32_t(uint8_t(out[outIdx+3]) << 0);
tmp47 = tmp48 | tmp49 | tmp50 | tmp51; tmp46 = tmp47 | tmp48 | tmp49 | tmp50;
outIdx+=4; outIdx+=4;
retValue.DownloadReq.SetProxy = std::string(out+outIdx, out+outIdx+tmp47); retValue.DownloadReq.SetProxy = std::string(out+outIdx, out+outIdx+tmp46);
outIdx+=tmp47; outIdx+=tmp46;
} }
{ {
uint32_t tmp52 = 0; uint32_t tmp51 = 0;
uint32_t tmp53 = uint32_t(uint8_t(out[outIdx+0]) << 24); uint32_t tmp52 = uint32_t(uint8_t(out[outIdx+0]) << 24);
uint32_t tmp54 = uint32_t(uint8_t(out[outIdx+1]) << 16); uint32_t tmp53 = uint32_t(uint8_t(out[outIdx+1]) << 16);
uint32_t tmp55 = uint32_t(uint8_t(out[outIdx+2]) << 8); uint32_t tmp54 = uint32_t(uint8_t(out[outIdx+2]) << 8);
uint32_t tmp56 = uint32_t(uint8_t(out[outIdx+3]) << 0); uint32_t tmp55 = uint32_t(uint8_t(out[outIdx+3]) << 0);
tmp52 = tmp53 | tmp54 | tmp55 | tmp56; tmp51 = tmp52 | tmp53 | tmp54 | tmp55;
outIdx+=4; outIdx+=4;
for (uint32_t tmp57 = 0; tmp57 < tmp52; tmp57++) { for (uint32_t tmp56 = 0; tmp56 < tmp51; tmp56++) {
std::string tmp58; std::string tmp57;
{ {
uint32_t tmp59 = 0; uint32_t tmp58 = 0;
uint32_t tmp60 = uint32_t(uint8_t(out[outIdx+0]) << 24); uint32_t tmp59 = uint32_t(uint8_t(out[outIdx+0]) << 24);
uint32_t tmp61 = uint32_t(uint8_t(out[outIdx+1]) << 16); uint32_t tmp60 = uint32_t(uint8_t(out[outIdx+1]) << 16);
uint32_t tmp62 = uint32_t(uint8_t(out[outIdx+2]) << 8); uint32_t tmp61 = uint32_t(uint8_t(out[outIdx+2]) << 8);
uint32_t tmp63 = uint32_t(uint8_t(out[outIdx+3]) << 0); uint32_t tmp62 = uint32_t(uint8_t(out[outIdx+3]) << 0);
tmp59 = tmp60 | tmp61 | tmp62 | tmp63; tmp58 = tmp59 | tmp60 | tmp61 | tmp62;
outIdx+=4; outIdx+=4;
tmp58 = std::string(out+outIdx, out+outIdx+tmp59); tmp57 = std::string(out+outIdx, out+outIdx+tmp58);
outIdx+=tmp59; outIdx+=tmp58;
} }
std::vector<std::string> tmp64; std::vector<std::string> tmp63;
{ {
uint32_t tmp65 = 0; uint32_t tmp64 = 0;
uint32_t tmp66 = uint32_t(uint8_t(out[outIdx+0]) << 24); uint32_t tmp65 = uint32_t(uint8_t(out[outIdx+0]) << 24);
uint32_t tmp67 = uint32_t(uint8_t(out[outIdx+1]) << 16); uint32_t tmp66 = uint32_t(uint8_t(out[outIdx+1]) << 16);
uint32_t tmp68 = uint32_t(uint8_t(out[outIdx+2]) << 8); uint32_t tmp67 = uint32_t(uint8_t(out[outIdx+2]) << 8);
uint32_t tmp69 = uint32_t(uint8_t(out[outIdx+3]) << 0); uint32_t tmp68 = uint32_t(uint8_t(out[outIdx+3]) << 0);
tmp65 = tmp66 | tmp67 | tmp68 | tmp69; tmp64 = tmp65 | tmp66 | tmp67 | tmp68;
outIdx+=4; outIdx+=4;
for (uint32_t tmp70 = 0; tmp70 < tmp65; tmp70++) { for (uint32_t tmp69 = 0; tmp69 < tmp64; tmp69++) {
std::string tmp71; std::string tmp70;
{ {
uint32_t tmp72 = 0; uint32_t tmp71 = 0;
uint32_t tmp73 = uint32_t(uint8_t(out[outIdx+0]) << 24); uint32_t tmp72 = uint32_t(uint8_t(out[outIdx+0]) << 24);
uint32_t tmp74 = uint32_t(uint8_t(out[outIdx+1]) << 16); uint32_t tmp73 = uint32_t(uint8_t(out[outIdx+1]) << 16);
uint32_t tmp75 = uint32_t(uint8_t(out[outIdx+2]) << 8); uint32_t tmp74 = uint32_t(uint8_t(out[outIdx+2]) << 8);
uint32_t tmp76 = uint32_t(uint8_t(out[outIdx+3]) << 0); uint32_t tmp75 = uint32_t(uint8_t(out[outIdx+3]) << 0);
tmp72 = tmp73 | tmp74 | tmp75 | tmp76; tmp71 = tmp72 | tmp73 | tmp74 | tmp75;
outIdx+=4; outIdx+=4;
tmp71 = std::string(out+outIdx, out+outIdx+tmp72); tmp70 = std::string(out+outIdx, out+outIdx+tmp71);
outIdx+=tmp72; outIdx+=tmp71;
} }
tmp64.push_back(tmp71); tmp63.push_back(tmp70);
} }
} }
retValue.DownloadReq.HeaderMap[tmp58] = tmp64; retValue.DownloadReq.HeaderMap[tmp57] = tmp63;
} }
} }
retValue.DownloadReq.SkipRemoveTs = (bool) out[outIdx]; retValue.DownloadReq.SkipRemoveTs = (bool) out[outIdx];
@ -449,92 +446,91 @@ std::string RunDownload_Req_ToCurlStr(RunDownload_Req in0){
std::string in; std::string in;
{ {
{ {
uint32_t tmp33 = in0.M3u8Url.length(); uint32_t tmp32 = in0.M3u8Url.length();
char tmp34[4]; char tmp33[4];
tmp34[0] = (uint32_t(tmp33) >> 24) & 0xFF; tmp33[0] = (uint32_t(tmp32) >> 24) & 0xFF;
tmp34[1] = (uint32_t(tmp33) >> 16) & 0xFF; tmp33[1] = (uint32_t(tmp32) >> 16) & 0xFF;
tmp34[2] = (uint32_t(tmp33) >> 8) & 0xFF; tmp33[2] = (uint32_t(tmp32) >> 8) & 0xFF;
tmp34[3] = (uint32_t(tmp33) >> 0) & 0xFF; tmp33[3] = (uint32_t(tmp32) >> 0) & 0xFF;
in.append(tmp34, 4); in.append(tmp33, 4);
in.append(in0.M3u8Url); in.append(in0.M3u8Url);
} }
in.append((char*)(&in0.Insecure), 1); in.append((char*)(&in0.Insecure), 1);
{ {
uint32_t tmp35 = in0.SaveDir.length(); uint32_t tmp34 = in0.SaveDir.length();
char tmp36[4]; char tmp35[4];
tmp36[0] = (uint32_t(tmp35) >> 24) & 0xFF; tmp35[0] = (uint32_t(tmp34) >> 24) & 0xFF;
tmp36[1] = (uint32_t(tmp35) >> 16) & 0xFF; tmp35[1] = (uint32_t(tmp34) >> 16) & 0xFF;
tmp36[2] = (uint32_t(tmp35) >> 8) & 0xFF; tmp35[2] = (uint32_t(tmp34) >> 8) & 0xFF;
tmp36[3] = (uint32_t(tmp35) >> 0) & 0xFF; tmp35[3] = (uint32_t(tmp34) >> 0) & 0xFF;
in.append(tmp36, 4); in.append(tmp35, 4);
in.append(in0.SaveDir); in.append(in0.SaveDir);
} }
{ {
uint32_t tmp37 = in0.FileName.length(); uint32_t tmp36 = in0.FileName.length();
char tmp38[4]; char tmp37[4];
tmp38[0] = (uint32_t(tmp37) >> 24) & 0xFF; tmp37[0] = (uint32_t(tmp36) >> 24) & 0xFF;
tmp38[1] = (uint32_t(tmp37) >> 16) & 0xFF; tmp37[1] = (uint32_t(tmp36) >> 16) & 0xFF;
tmp38[2] = (uint32_t(tmp37) >> 8) & 0xFF; tmp37[2] = (uint32_t(tmp36) >> 8) & 0xFF;
tmp38[3] = (uint32_t(tmp37) >> 0) & 0xFF; tmp37[3] = (uint32_t(tmp36) >> 0) & 0xFF;
in.append(tmp38, 4); in.append(tmp37, 4);
in.append(in0.FileName); in.append(in0.FileName);
} }
in.append((char*)(&in0.RemoteName), 1);
{ {
char tmp39[4]; char tmp38[4];
tmp39[0] = (uint32_t(in0.SkipTsCountFromHead) >> 24) & 0xFF; tmp38[0] = (uint32_t(in0.SkipTsCountFromHead) >> 24) & 0xFF;
tmp39[1] = (uint32_t(in0.SkipTsCountFromHead) >> 16) & 0xFF; tmp38[1] = (uint32_t(in0.SkipTsCountFromHead) >> 16) & 0xFF;
tmp39[2] = (uint32_t(in0.SkipTsCountFromHead) >> 8) & 0xFF; tmp38[2] = (uint32_t(in0.SkipTsCountFromHead) >> 8) & 0xFF;
tmp39[3] = (uint32_t(in0.SkipTsCountFromHead) >> 0) & 0xFF; tmp38[3] = (uint32_t(in0.SkipTsCountFromHead) >> 0) & 0xFF;
in.append(tmp39, 4); in.append(tmp38, 4);
} }
{ {
uint32_t tmp40 = in0.SetProxy.length(); uint32_t tmp39 = in0.SetProxy.length();
char tmp41[4]; char tmp40[4];
tmp41[0] = (uint32_t(tmp40) >> 24) & 0xFF; tmp40[0] = (uint32_t(tmp39) >> 24) & 0xFF;
tmp41[1] = (uint32_t(tmp40) >> 16) & 0xFF; tmp40[1] = (uint32_t(tmp39) >> 16) & 0xFF;
tmp41[2] = (uint32_t(tmp40) >> 8) & 0xFF; tmp40[2] = (uint32_t(tmp39) >> 8) & 0xFF;
tmp41[3] = (uint32_t(tmp40) >> 0) & 0xFF; tmp40[3] = (uint32_t(tmp39) >> 0) & 0xFF;
in.append(tmp41, 4); in.append(tmp40, 4);
in.append(in0.SetProxy); in.append(in0.SetProxy);
} }
{ {
uint32_t tmp42 = in0.HeaderMap.size(); uint32_t tmp41 = in0.HeaderMap.size();
char tmp43[4]; char tmp42[4];
tmp43[0] = (uint32_t(tmp42) >> 24) & 0xFF; tmp42[0] = (uint32_t(tmp41) >> 24) & 0xFF;
tmp43[1] = (uint32_t(tmp42) >> 16) & 0xFF; tmp42[1] = (uint32_t(tmp41) >> 16) & 0xFF;
tmp43[2] = (uint32_t(tmp42) >> 8) & 0xFF; tmp42[2] = (uint32_t(tmp41) >> 8) & 0xFF;
tmp43[3] = (uint32_t(tmp42) >> 0) & 0xFF; tmp42[3] = (uint32_t(tmp41) >> 0) & 0xFF;
in.append(tmp43, 4); in.append(tmp42, 4);
for(std::map<std::string, std::vector<std::string>>::iterator tmp44 = in0.HeaderMap.begin(); tmp44 != in0.HeaderMap.end(); ++tmp44) { for(std::map<std::string, std::vector<std::string>>::iterator tmp43 = in0.HeaderMap.begin(); tmp43 != in0.HeaderMap.end(); ++tmp43) {
{ {
uint32_t tmp45 = tmp44->first.length(); uint32_t tmp44 = tmp43->first.length();
char tmp46[4]; char tmp45[4];
tmp46[0] = (uint32_t(tmp45) >> 24) & 0xFF; tmp45[0] = (uint32_t(tmp44) >> 24) & 0xFF;
tmp46[1] = (uint32_t(tmp45) >> 16) & 0xFF; tmp45[1] = (uint32_t(tmp44) >> 16) & 0xFF;
tmp46[2] = (uint32_t(tmp45) >> 8) & 0xFF; tmp45[2] = (uint32_t(tmp44) >> 8) & 0xFF;
tmp46[3] = (uint32_t(tmp45) >> 0) & 0xFF; tmp45[3] = (uint32_t(tmp44) >> 0) & 0xFF;
in.append(tmp46, 4); in.append(tmp45, 4);
in.append(tmp44->first); in.append(tmp43->first);
} }
{ {
uint32_t tmp47 = tmp44->second.size(); uint32_t tmp46 = tmp43->second.size();
char tmp48[4]; char tmp47[4];
tmp48[0] = (uint32_t(tmp47) >> 24) & 0xFF; tmp47[0] = (uint32_t(tmp46) >> 24) & 0xFF;
tmp48[1] = (uint32_t(tmp47) >> 16) & 0xFF; tmp47[1] = (uint32_t(tmp46) >> 16) & 0xFF;
tmp48[2] = (uint32_t(tmp47) >> 8) & 0xFF; tmp47[2] = (uint32_t(tmp46) >> 8) & 0xFF;
tmp48[3] = (uint32_t(tmp47) >> 0) & 0xFF; tmp47[3] = (uint32_t(tmp46) >> 0) & 0xFF;
in.append(tmp48, 4); in.append(tmp47, 4);
for (uint32_t tmp49=0; tmp49 < tmp47; ++tmp49) { for (uint32_t tmp48=0; tmp48 < tmp46; ++tmp48) {
{ {
uint32_t tmp50 = tmp44->second[tmp49].length(); uint32_t tmp49 = tmp43->second[tmp48].length();
char tmp51[4]; char tmp50[4];
tmp51[0] = (uint32_t(tmp50) >> 24) & 0xFF; tmp50[0] = (uint32_t(tmp49) >> 24) & 0xFF;
tmp51[1] = (uint32_t(tmp50) >> 16) & 0xFF; tmp50[1] = (uint32_t(tmp49) >> 16) & 0xFF;
tmp51[2] = (uint32_t(tmp50) >> 8) & 0xFF; tmp50[2] = (uint32_t(tmp49) >> 8) & 0xFF;
tmp51[3] = (uint32_t(tmp50) >> 0) & 0xFF; tmp50[3] = (uint32_t(tmp49) >> 0) & 0xFF;
in.append(tmp51, 4); in.append(tmp50, 4);
in.append(tmp44->second[tmp49]); in.append(tmp43->second[tmp48]);
} }
} }
} }
@ -549,15 +545,15 @@ std::string RunDownload_Req_ToCurlStr(RunDownload_Req in0){
std::string retValue; std::string retValue;
int outIdx = 0; int outIdx = 0;
{ {
uint32_t tmp52 = 0; uint32_t tmp51 = 0;
uint32_t tmp53 = uint32_t(uint8_t(out[outIdx+0]) << 24); uint32_t tmp52 = uint32_t(uint8_t(out[outIdx+0]) << 24);
uint32_t tmp54 = uint32_t(uint8_t(out[outIdx+1]) << 16); uint32_t tmp53 = uint32_t(uint8_t(out[outIdx+1]) << 16);
uint32_t tmp55 = uint32_t(uint8_t(out[outIdx+2]) << 8); uint32_t tmp54 = uint32_t(uint8_t(out[outIdx+2]) << 8);
uint32_t tmp56 = uint32_t(uint8_t(out[outIdx+3]) << 0); uint32_t tmp55 = uint32_t(uint8_t(out[outIdx+3]) << 0);
tmp52 = tmp53 | tmp54 | tmp55 | tmp56; tmp51 = tmp52 | tmp53 | tmp54 | tmp55;
outIdx+=4; outIdx+=4;
retValue = std::string(out+outIdx, out+outIdx+tmp52); retValue = std::string(out+outIdx, out+outIdx+tmp51);
outIdx+=tmp52; outIdx+=tmp51;
} }
if (out != NULL) { if (out != NULL) {
free(out); free(out);

View File

@ -13,13 +13,12 @@ struct RunDownload_Req{
bool Insecure; bool Insecure;
std::string SaveDir; std::string SaveDir;
std::string FileName; std::string FileName;
bool RemoteName;
int32_t SkipTsCountFromHead; int32_t SkipTsCountFromHead;
std::string SetProxy; std::string SetProxy;
std::map<std::string, std::vector<std::string>> HeaderMap; std::map<std::string, std::vector<std::string>> HeaderMap;
bool SkipRemoveTs; bool SkipRemoveTs;
bool ProgressBarShow; bool ProgressBarShow;
RunDownload_Req(): Insecure(false),RemoteName(false),SkipTsCountFromHead(0),SkipRemoveTs(false),ProgressBarShow(false){} RunDownload_Req(): Insecure(false),SkipTsCountFromHead(0),SkipRemoveTs(false),ProgressBarShow(false){}
}; };
struct RunDownload_Resp{ struct RunDownload_Resp{
std::string ErrMsg; std::string ErrMsg;