Advertisement
Guest User

getcflurl.ps1 v0.6 for Windows

a guest
Sep 22nd, 2017
4,234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. remove-item -path C:\VMS\cfl*
  2.  
  3. $INTER=(Invoke-WebRequest -Uri 'https://reddit.com/r/cflstreams').Links.href | select-string -pattern http |select-string -pattern game_thread
  4. # write-host $INTER
  5.  
  6. foreach ($i in $INTER)
  7. {
  8. $i = [string] $i
  9. write-host $i
  10. # Find out type of string
  11. # $i.GetType().FullName
  12.  
  13. $YOUTUBE=(Invoke-WebRequest -Uri $i).Links.href | select-string -pattern youtube | select-string -pattern http | select-string -pattern watch
  14. #write-host $YOUTUBE
  15.  
  16. $x=1
  17.  
  18. foreach ( $YT in $YOUTUBE )
  19. {
  20. $YT = [string] $YT
  21. $YTURL,$ADDON=$YT.split("=")
  22. # write-host $ADDON
  23.  
  24. $SPLITLINE=$i -split "/"
  25. $FILENAME=$SPLITLINE[7]
  26.  
  27. # write-host $FILENAME
  28.  
  29. $OUTPUT="plugin://plugin.video.youtube/?path=/root/video\&action=play_video&videoid="+$ADDON.substring(0,11)
  30. # write-host $OUTPUT
  31. $OUTPUT | out-file c:\VMs\cfl+youtube+$FILENAME+$x.strm
  32.  
  33. write-host "https://www.youtube.com/watch?v=$ADDON"
  34.  
  35. $x=$x+1
  36.  
  37. }
  38.  
  39. $YOUTUBE=(Invoke-WebRequest -Uri $i).Links.href | select-string -pattern youtu.be | select-string -pattern http
  40. #write-host $YOUTUBE
  41.  
  42. foreach ( $YT in $YOUTUBE )
  43. {
  44. $YT = [string] $YT
  45. $YTSPLIT= $YT -split "/"
  46. $ADDON=$YTSPLIT[3]
  47. # write-host $ADDON
  48.  
  49. $SPLITLINE=$i -split "/"
  50. $FILENAME=$SPLITLINE[7]
  51.  
  52. # write-host $FILENAME
  53.  
  54. $OUTPUT="plugin://plugin.video.youtube/?path=/root/video\&action=play_video&videoid="+$ADDON.substring(0,11)
  55. # write-host $OUTPUT
  56. $OUTPUT | out-file c:\VMs\cfl+youtube+$FILENAME+$x.strm
  57.  
  58. write-host "https://www.youtube.com/watch?v=$ADDON"
  59.  
  60. $x=$x+1
  61.  
  62. }
  63.  
  64.  
  65. $GRANDMA=(Invoke-WebRequest -Uri $i).Links.href | select-string -pattern grandma.press
  66.  
  67. # write-host $GRANDMA
  68.  
  69. foreach ( $Y in $GRANDMA )
  70. {
  71. $Y = [string] $Y
  72.  
  73. $SPLITLINE=$i -split "/"
  74. $FILENAME=$SPLITLINE[7]
  75.  
  76. # This just tells invoke-webrequest to ignore misformatted webpages (grandma.press is guilty of this)
  77. $netAssembly = [Reflection.Assembly]::GetAssembly([System.Net.Configuration.SettingsSection])
  78.  
  79. if($netAssembly)
  80. {
  81. $bindingFlags = [Reflection.BindingFlags] "Static,GetProperty,NonPublic"
  82. $settingsType = $netAssembly.GetType("System.Net.Configuration.SettingsSectionInternal")
  83.  
  84. $instance = $settingsType.InvokeMember("Section", $bindingFlags, $null, $null, @())
  85.  
  86. if($instance)
  87. {
  88. $bindingFlags = "NonPublic","Instance"
  89. $useUnsafeHeaderParsingField = $settingsType.GetField("useUnsafeHeaderParsing", $bindingFlags)
  90.  
  91. if($useUnsafeHeaderParsingField)
  92. {
  93. $useUnsafeHeaderParsingField.SetValue($instance, $true)
  94. }
  95. }
  96. }
  97.  
  98. # end section for bad format webpages
  99.  
  100. $GRANDMAYOUTUBE=(Invoke-WebRequest -Uri $Y)
  101.  
  102.  
  103. $YT=$GRANDMAYOUTUBE.tostring() -split "[`r`n]" | select-string "youtube"
  104. $YT= [string] $YT
  105.  
  106. $YTURL,$THEREST=$YT.split("?")
  107. $ADDON=$YTURL.Substring($YTURL.Length - 11)
  108.  
  109. write-host "https://www.youtube.com/watch?v=$ADDON"
  110.  
  111. $OUTPUT="plugin://plugin.video.youtube/?path=/root/video\&action=play_video&videoid="+$ADDON
  112. # write-host $OUTPUT
  113. $OUTPUT | out-file c:\VMs\cfl+youtube+$FILENAME+$x.strm
  114.  
  115. $x=$x+1
  116. }
  117.  
  118. $M3U8=(Invoke-WebRequest -Uri $i).Links.href | select-string -pattern m3u8
  119.  
  120. $x=1
  121.  
  122. foreach ( $Y in $M3U8 )
  123. {
  124. $SPLITLINE=$i -split "/"
  125. $FILENAME=$SPLITLINE[7]
  126.  
  127. $Y | out-file c:\VMs\cfl+m3u8+$FILENAME+$x.strm
  128. write-host $Y
  129.  
  130. $x=$x+1
  131.  
  132. }
  133.  
  134. # $i="https://www.reddit.com/r/soccerstreams/comments/71cseu/1900_gmt_manchester_united_vs_burton_albion/"
  135. $CFLACERAW=(Invoke-WebRequest -Uri $i)
  136. $CFLACE=$CFLACERAW.tostring() -split "[`r`n]" | select-string "acestream://"
  137. # write-host $CFLACE
  138.  
  139. $x=1
  140.  
  141. foreach ( $Y in $CFLACE )
  142. {
  143. $SPLITLINE=$i -split "/"
  144. $FILENAME=$SPLITLINE[7]
  145.  
  146. $Y = [string] $Y
  147. $CFLACESTREAM=($Y -split "acestream://")[-1]
  148. # $THEREST1,$THEREST2,$CFLACESTREAMRAW=$Y.split("/")
  149. # $CFLACESTREAM=($CFLACESTREAMRAW.Split(" "))[0]
  150. # write-host "CFLACESTREAM= " $CFLACESTREAM
  151.  
  152. if ($CFLACESTREAM.length -ge 39)
  153. {
  154. $CFLACESTREAM=$CFLACESTREAM.substring(0,40)
  155. $OUTPUT="plugin://program.plexus/?mode=1&url=acestream://"+$CFLACESTREAM
  156. # write-host $OUTPUT
  157. write-host "acestream://$CFLACESTREAM"
  158. $OUTPUT | out-file c:\VMs\cfl+acestream+$FILENAME+$x.strm
  159. }
  160.  
  161. $x=$x+1
  162.  
  163. }
  164.  
  165. # $CFLACERAW=(Invoke-WebRequest -Uri $i)
  166. # write-host $CFLACERAW
  167. # $CFLACE=$CFLACERAW.tostring() -split "[`r`n]" | select-string "Acestream" -casesensitive # -Context 0,4 # | select-string -pattern "code"
  168. # write-host "CFLACE= " $CFLACE
  169. write-host ""
  170. write-host ""
  171. }
  172.  
  173. Write-Host "Press any key to continue ..."
  174.  
  175. $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement