Advertisement
Najeebsk

ALL-SEARCH.ahk

Jan 24th, 2022
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Modified=20140412
  2.  
  3. SplitPath,a_scriptname, name, dir, ext, name_no_ext, drive
  4. F1=%a_scriptdir%\%name_no_ext%.ini
  5. I=10                 ;- total checkboxes
  6.  
  7.  
  8. src=Najeeb Khan
  9.  
  10.  
  11. Gui,2: Color, ControlColor, Black
  12. Gui,2: Font, CDefault, Lucida Console
  13.  
  14.  
  15. Loop,%i%
  16.    {
  17.    IniRead, Ch%A_Index%, %f1%, ss, Cb%A_Index% , 0
  18.     If (Ch%A_Index% = 1)
  19.        Cb%A_Index% = Checked
  20.     Else
  21.        Cb%A_Index% =
  22.    }
  23.  
  24.  
  25. Gui,2:  Show, x100 y5 w300 h440, %name_no_ext%
  26.  
  27. Gui,2: Add, Edit,      x20 y5  w265 h20 cWhite vSearch,%src%
  28.  
  29. Gui,2:  Add, CheckBox, x20 y40  vCh1  %cb1%   cYellow, Google
  30. Gui,2:  Add, CheckBox, x20 y65  vCh2  %cb2%   cYellow, Google I``m feeling lucky
  31. Gui,2:  Add, CheckBox, x20 y90  vCh3  %cb3%   cYellow, Bing   Pictures
  32. Gui,2:  Add, CheckBox, x20 y115 vCh4  %cb4%   cYellow, Flickr Pictures
  33. Gui,2:  Add, CheckBox, x20 y140 vCh5  %cb5%   cYellow, Google Pictures
  34. Gui,2:  Add, CheckBox, x20 y165 vCh6  %cb6%   cYellow, Google News
  35. Gui,2:  Add, CheckBox, x20 y190 vCh7  %cb7%   cYellow, Google News NL
  36. Gui,2:  Add, CheckBox, x20 y215 vCh8  %cb8%   cYellow, Google Video
  37. Gui,2:  Add, CheckBox, x20 y240 vCh9  %cb9%   cYellow, Google PDF
  38. Gui,2:  Add, CheckBox, x20 y265 vCh10 %cb10%  cYellow, Wikipedia
  39.  
  40. Gui,2:  Add, CheckBox, x20 y330 vCh98 gCheckAll   cYellow, Select All
  41. Gui,2:  Add, CheckBox, x20 y355 vCh99 gUnCheckAll cYellow, De-Select All
  42.  
  43. Gui,2:  Add, Button,   x10 y400 w100 h26 gAA ,Start
  44. GuiControl,2:Focus,search
  45. return
  46.  
  47.  
  48. CheckAll:
  49. Loop, %i%
  50.     GuiControl,2:, Ch%A_Index%, 1
  51. GuiControl,2:, Ch99, 0
  52. Return
  53.  
  54. UnCheckAll:
  55. Loop, %i%
  56.     GuiControl,2:, Ch%A_Index%, 0
  57. GuiControl,2:, Ch98, 0
  58. Return
  59.  
  60.  
  61. AA:
  62. Gui,2: submit, nohide
  63. StringReplace,Search, Search, %A_space%, +, All
  64. search=`%22%search%`%22
  65.  
  66.   if Ch1
  67.     run,http://www.google.de/search?hl=&q=%search%
  68.   if Ch2
  69.     run,http://www.google.com/search?btnI=I`%27m+Feeling+Lucky&q=%search%
  70.   if Ch3
  71.     run,http://www.bing.com/images/search?q=%search%&FORM=HDRSC2
  72.   if Ch4
  73.     run,https://www.flickr.com/search/?q=%search%
  74.   if Ch5
  75.     run,https://www.google.com/search?q=%search%&tbm=isch
  76.   if Ch6
  77.     run,https://www.google.com/search?q=%search%#q=%search%&tbm=nws
  78.   if Ch7
  79.     run,https://www.google.com/search?q=%search%#q=%search%&tbm=nws&hl=nl  ;- hl=nl nederlands
  80.   if Ch8
  81.     run,https://www.google.com/search?q=%search%#q=%search%&tbm=vid
  82.   if Ch9
  83.     run,http://www.google.de/search?hl=&q=%search% filetype:pdf
  84.   if Ch10
  85.      {
  86.      StringReplace,search,search,+,%A_space%, All
  87.      StringUpper,search,search,T
  88.      StringReplace,search,search,%A_space%,_, All
  89.      StringReplace,Search,Search,`%22, , All
  90.      run, http://en.wikipedia.org/wiki/%search%
  91.      }
  92.  
  93. return
  94.  
  95.  
  96. 2GuiClose:
  97. Gui,2:  Submit
  98. Loop,%i%
  99.    {
  100.    e= % ch%a_index%
  101.    IniWrite, %e%, %f1%, ss, Cb%a_index%
  102.    }
  103. ExitApp
  104. ;===========================================================================
  105. ;- yt-dlp.exe for test / download youtube or dailymotion etc ... as MP4 or MP3
  106. ;- creates a folder at desktop > \M_VIDEO_AUDIO  ( downloaded MP3 or MP4 is here )
  107. ;======================================================================================
  108. ;-
  109. ;- https://github.com/yt-dlp/yt-dlp#update
  110. ;- https://github.com/yt-dlp/yt-dlp
  111. ;- https://write.corbpie.com/downloading-youtube-videos-and-playlists-with-yt-dlp/
  112. ;- https://youtube-dl.org/latest/youtube-dl.exe      ( replaced with yt-dlp / no update since 2021-06-06 )
  113. ;- https://ffmpeg.org/download.html#build-windows    ( needed for MP3 / 7zip-file)
  114. ;-
  115. ;--
  116. fdpro1:=a_scriptdir . "\YT_programs1"   ;- here only yt-dlp.exe ( for VIDEO / don't get MP4  with ffmpeg  (?) )
  117. ifnotexist,%fdpro1%
  118.   filecreatedir,%fdpro1%
  119. ;-
  120. fdpro2:=a_scriptdir . "\YT_programs2"   ;- here yt-dlp-exe ffmpeg.exe  ffprobe.exe ( for MP3 )
  121. ifnotexist,%fdpro2%
  122.   filecreatedir,%fdpro2%
  123. ;-
  124. ;-
  125. youtubedl1:=fdpro1 . "\yt-dlp.exe"      ;- only yt-dlp.exe ( for VIDEO MP4 )
  126. youtubedl2:=fdpro2 . "\yt-dlp.exe"      ;-                 ( for AUDIO MP3 )
  127. ;-
  128. ifexist,%youtubedl1%
  129.  {
  130.  loop,%youtubedl1%        
  131.    SP1:=A_loopFileShortPath
  132.  ;RunWait, %comspec% /k %sp1% -U     ;- Update
  133.  }
  134. ;-
  135. ifexist,%youtubedl2%
  136.  {
  137.  loop,%youtubedl2%        
  138.    SP2:=A_loopFileShortPath
  139.  ;RunWait, %comspec% /k %sp2% -U     ;- Update
  140.  }
  141. else
  142.  {
  143.  F0:="https://youtube-dl.org/latest/youtube-dl.exe"
  144.  F1:="https://github.com/yt-dlp/yt-dlp#update"
  145.  F2:="https://ffmpeg.org/download.html#build-windows"
  146.  run,%f1%
  147.  run,%f2%
  148.  return
  149.  }
  150. ;-----
  151.  
  152. ;--
  153. fdmpx:=a_desktop . "\M_VIDEO_AUDIO"
  154. ifnotexist,%fdmpx%
  155.   filecreatedir,%fdmpx%
  156. ;--
  157. ;-------------------------------------------------------------------
  158.  
  159. url:="https://www.youtube.com/watch?v=PtzaMHjf_3Q"  ;- A mouse divided 1953 cartoon
  160. ;url:="https://www.dailymotion.com/video/x6bap58"    ;- Maitetxu mia - lilian de celis
  161. ;---------------
  162. ;==============
  163. ;-- VIDEO >
  164. {
  165. Runwait, %comspec% /k %sp1% %url% --encoding UTF-8 --verbose --youtube-skip-dash-manifest -o "%fdmpx%\`%(title)s-`%(uploader)s-`%(id)s.`%(ext)s"
  166. ;- create xy.vtt file if subtitle exist
  167. ;RunWait, %comspec% /k %sp1% %url% --encoding UTF-8 --verbose --youtube-skip-dash-manifest -k --write-auto-sub --sub-lang de -o "%fdmpx%\`%(title)s$`%(uploader)s$`%(id)s.`%(ext)s"
  168. }
  169. ;-- MUSIC >
  170. ;RunWait, %comspec% /k %sp2% %url% -x --audio-format mp3 --audio-quality 320k --encoding UTF-8 --embed-thumbnail --youtube-skip-dash-manifest -o "%fdmpx%\`%(title)s$`%(uploader)s$`%(id)s.`%(ext)s" ;- needs ffmpeg.exe
  171. return
  172. ;=================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement