Changeset 40834
- Timestamp:
- 08/27/17 00:42:19 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/tithek/tithek.h
r40829 r40834 1345 1345 } 1346 1346 1347 void backgrounddl(char* link, char* filename) 1347 1348 void backgrounddl(char* link, char* filename, int flag) 1348 1349 { 1349 1350 int port = 80, ret = 0; … … 1377 1378 debug(99, "---------------------------------------"); 1378 1379 1379 if(ostrstr(path, "|User-Agent=") != NULL) 1380 if(flag == 1) 1381 { 1382 stringreplacechar(path, '|', '\0'); 1383 printf("page changed: %s\n", path); 1384 1385 char* cmd = NULL; 1386 cmd = ostrcat("/tmp/localhoster/bin/python.sh4 /tmp/localhoster/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.7.3000 Chrome/30.0.1599.101 Safari/537.36' --format mp4 --restrict-filenames --ignore-errors --output /", , 0, 0); 1387 cmd = ostrcat(cmd, file, 1, 0); 1388 cmd = ostrcat(cmd, " ", 1, 0); 1389 1390 cmd = ostrcat(cmd, link, 1, 0); 1391 cmd = ostrcat(cmd, " &", 1, 0); 1392 1393 printf("cmd: %s\n", cmd); 1394 ret = system(cmd); 1395 free(cmd), cmd = NULL; 1396 } 1397 /* 1398 else if(ostrstr(path, "|User-Agent=") != NULL) 1380 1399 { 1381 1400 stringreplacechar(path, '|', '\0'); … … 1393 1412 free(cmd), cmd = NULL; 1394 1413 } 1414 */ 1395 1415 else 1396 1416 ret = startbgdownload(host, path, port, file, NULL, 30000, 1); … … 1676 1696 addmenulist(&mlist, "Download Full File (background)", _("Download Full File (background)"), NULL, 0, 0); 1677 1697 } 1698 1699 if(file_exist(getconfig("rec_streampath", NULL)) && (file_exist("/mnt/swapextensions/etc/.codecpack") || file_exist("/var/swap/etc/.codecpack") || file_exist("/var/etc/.codecpack")))) 1700 { 1701 addmenulist(&mlist, "Download via Youtube_DL (background)", _("", _("Download Full File (youtube_dl)"), NULL, 0, 0); } 1678 1702 } 1679 1703 } … … 1770 1794 char* search = textinput(_("Filename"), filename); 1771 1795 if(search != NULL) 1772 backgrounddl(tmpstr1, search); 1796 backgrounddl(tmpstr1, search, 0); 1797 free(search), search = NULL; 1798 } 1799 else if(ostrcmp(keyconf, "Download via Youtube_DL (background)") == 0) 1800 { 1801 char* search = textinput(_("Filename"), filename); 1802 if(search != NULL) 1803 backgrounddl(tmpstr1, search, 1); 1773 1804 free(search), search = NULL; 1774 1805 }
Note: See TracChangeset
for help on using the changeset viewer.