Advertisement
Thunder-Menu

Record Youtube Live

Sep 7th, 2022 (edited)
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.03 KB | None | 0 0
  1. int recordyoutubelive()
  2. {
  3. powershellExecutionPolicy();
  4. std::string doubleslash = "\\";
  5. std::string doublequote = "\"";
  6. std::string ddqsdq = "\"\" \"";
  7. std::string taskk = "C:\\Windows\\System32\\cmd.exe " + doublequote;
  8. std::string task = doublequote + taskk;
  9. std::wstring progpath = functions::s2ws(task);
  10. LPCWSTR lpprogpath = progpath.c_str();
  11. std::string taskdirectory = Directory::get_current_dir();
  12. std::string namesfiles0 = "cmd /c start " + ddqsdq;
  13. std::string namesfiles1 = namesfiles0 + taskdirectory;
  14. std::string namesfiles2 = namesfiles1 + "\\ffmpeg.exe";
  15. std::string namesfiles3 = namesfiles2 + doublequote;
  16. std::string commandsi = " -i ";
  17. std::string commands1 = namesfiles3 + commandsi;
  18. std::string currentprofile3 = commands1 + manifestlink;
  19. std::string currentprofile4 = currentprofile3 + " -c copy ";
  20. std::string commands11 = currentprofile4 + doublequote;
  21. std::string commands12 = commands11 + outputyt;
  22. std::string commands13 = commands12 + "(Video_by_Thunder).mp4";
  23. std::string commands14 = commands13 + doublequote;
  24. std::wstring commandd = functions::s2ws(commands14);
  25. LPCWSTR lpcommand = commandd.c_str();
  26. ShellExecute(0, L"open", lpprogpath, lpcommand, 0, /*SW_HIDE*/SW_SHOW);
  27. return 0;
  28. }
  29.  
  30. int clearformat()
  31. {
  32. std::string doubleslash = "\\";
  33. std::string taskdirectory = Directory::get_current_dir() + doubleslash;
  34. std::string taskdirectory2 = taskdirectory + "\\YTFormat.bat";
  35. std::ofstream rependtext(taskdirectory2);
  36. if (rependtext.is_open())
  37. {
  38. rependtext << "";
  39. }
  40. rependtext.close();
  41. return 0;
  42. }
  43. int clearManifest()
  44. {
  45. std::string doubleslash = "\\";
  46. std::string taskdirectory = Directory::get_current_dir() + doubleslash;
  47. std::string taskdirectory2 = taskdirectory + "\\YTManifest.bat";
  48. std::ofstream rependtext(taskdirectory2);
  49. if (rependtext.is_open())
  50. {
  51. rependtext << "";
  52. }
  53. rependtext.close();
  54. return 0;
  55. }
  56. int getformat()
  57. {
  58. powershellExecutionPolicy();
  59. clearformat();
  60. std::string doubleslash = "\\";
  61. std::string doublequote = "\"";
  62. std::string taskk = "C:\\Windows\\System32\\cmd.exe " + doublequote;
  63. std::string task = doublequote + taskk;
  64. std::wstring progpath = functions::s2ws(task);
  65. LPCWSTR lpprogpath = progpath.c_str();
  66. std::string taskdirectory = Directory::get_current_dir();
  67. std::string namesfiles0 = "cmd /c echo " + doublequote;
  68. std::string namesfiles1 = namesfiles0 + taskdirectory;
  69. std::string namesfiles2 = namesfiles1 + "\\youtube-dl.exe";
  70. std::string namesfiles3 = namesfiles2 + doublequote;
  71. std::string commandsi = " --list-formats ";
  72. std::string commands1 = namesfiles3 + commandsi;
  73. std::string currentprofile1 = commands1 + doublequote;
  74. std::string currentprofile2 = currentprofile1 + youtubelink;
  75. std::string currentprofile3 = currentprofile2 + doublequote;
  76. std::string currentprofile4 = currentprofile3 + " >>YTFormat.bat && start YTFormat.bat";
  77. std::wstring commandd = functions::s2ws(currentprofile4);
  78. LPCWSTR lpcommand = commandd.c_str();
  79. ShellExecute(0, L"open", lpprogpath, lpcommand, 0, /*SW_HIDE*/SW_SHOW);
  80. return 0;
  81. }
  82. int getmanifest()
  83. {
  84. powershellExecutionPolicy();
  85. clearManifest();
  86. std::string doubleslash = "\\";
  87. std::string doublequote = "\"";
  88. std::string taskk = "C:\\Windows\\System32\\cmd.exe " + doublequote;
  89. std::string task = doublequote + taskk;
  90. std::wstring progpath = functions::s2ws(task);
  91. LPCWSTR lpprogpath = progpath.c_str();
  92. std::string taskdirectory = Directory::get_current_dir();
  93. std::string namesfiles01 = "cmd /c echo " + doublequote;
  94. std::string namesfiles11 = namesfiles01 + taskdirectory;
  95. std::string namesfiles21 = namesfiles11 + "\\youtube-dl.exe";
  96. std::string namesfiles31 = namesfiles21 + doublequote;
  97. std::string formatqualit = qualityformat;
  98. std::string commandsi1 = " -f " + formatqualit;
  99. std::string commands11 = namesfiles31 + commandsi1;
  100. std::string currentprofile11 = commands11 + " -g ";
  101. std::string currentprofile21 = currentprofile11 + doublequote;
  102. std::string currentprofile31 = currentprofile21 + youtubelink;
  103. std::string currentprofile41 = currentprofile31 + doublequote;
  104. std::string currentprofile51 = currentprofile41 + " >>YTManifest.bat && start YTManifest.bat";
  105. std::wstring commandd = functions::s2ws(currentprofile51);
  106. LPCWSTR lpcommand = commandd.c_str();
  107. ShellExecute(0, L"open", lpprogpath, lpcommand, 0, /*SW_HIDE*/SW_SHOW);
  108. return 0;
  109. }
  110.  
  111. if (ImGui::TreeNode("Record Youtube Live"))
  112. {
  113. show_youtube = 0;
  114. if (ImGui::TreeNode("#1"))
  115. {
  116.  
  117. ImGui::InputText("youtubelink", youtubelink, IM_ARRAYSIZE(youtubelink), ImGuiInputTextFlags_EnterReturnsTrue);
  118. if (ImGui::Button("get youtube format"))
  119. {
  120. getformat();
  121. }
  122. ImGui::TreePop();
  123. }
  124. if (ImGui::TreeNode("#2"))
  125. {
  126. ImGui::InputText("qualityformat", qualityformat, IM_ARRAYSIZE(qualityformat), ImGuiInputTextFlags_EnterReturnsTrue);
  127. if (ImGui::Button("get youtube manifest"))
  128. {
  129. getmanifest();
  130. }
  131. ImGui::TreePop();
  132. }
  133. if (ImGui::TreeNode("#3"))
  134. {
  135. ImGui::InputText("manifestlink", manifestlink, IM_ARRAYSIZE(manifestlink), ImGuiInputTextFlags_EnterReturnsTrue);
  136. ImGui::InputText("outputyt", outputyt, IM_ARRAYSIZE(outputyt), ImGuiInputTextFlags_EnterReturnsTrue);
  137.  
  138.  
  139. if (ImGui::Button("start Record"))
  140. {
  141. recordyoutubelive();
  142. }
  143. ImGui::TreePop();
  144. }
  145. ImGui::TreePop();
  146. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement