Youtube’dan Link gösteren Addon
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
; youtube video search ; returns the first search result for your search terms ; usage for you ; ; trigger: /yt ; syntax: /yt <search terms> ; example: /yt charleston daft punk ; usage for other people ; ; triggers: !youtube @youtube !tube @tube ; syntax: @youtube <search terms> ; example: !tube charleston daft punk ; if you want to sort search by VIEW COUNT, use this line below ; sockwrite -nt $sockname GET /results?search_sort=video_view_count&search_query= $+ %searchstring ; ; if you want the regular search, use this line below ; sockwrite -nt $sockname GET /results?search_query= $+ %searchstring HTTP//1.1 ; ; the place im referring to is: under the heading on *:sockopen:ytsearch:{ alias yt { %channel = $chan if (%channel) { %saystyle = echo -t %channel } else { %saystyle = echo -at } %searchstring = $replace($1-,$chr(32),+) sockclose ytsearch sockopen ytsearch www.youtube.com 80 } on $*:TEXT:/^[!@](yt|youtube|tube) */Si:#: { %channel = $chan %saystyle = /msg %channel %searchstring = $replace($2-,$chr(32),+) if ($2 == $null) { %saystyle Search could not be completed | halt } sockclose ytsearch sockopen ytsearch www.youtube.com 80 } on *:sockopen:ytsearch:{ sockwrite -nt $sockname GET /results?search_query= $+ %searchstring HTTP//1.1 sockwrite -nt $sockname Host: youtube.com sockwrite -nt $sockname $crlf $crlf } on *:sockread:ytsearch:{ sockread -n %temp if (%founddesc_be) { unset %founddesc_be | %desc_be = $replace($remove(%temp, ),<br/>,$chr(32)) } if (<span id="BeginvidDesc isin %temp) %founddesc_be = k if (/watch?v= isin %temp) { %resulturl = $remove($gettok(%temp,2,32),href=",") } if (%foundtitle) { inc %titlecounter } if (%titlecounter = 1) { %searchtitle = $replace($remove($regsubex(%temp,/<a [^>]+>(.+?)</a>/,\1),<br/>, ),",$chr(34)) } if (<div> isin %temp) { %foundtitle = k | %titlecounter = 0 } if (<img src="/img/icn_star_full_19x20 isin %temp) { %done = k } if (%done) { sockclose ytsearch unset %done %saystyle Link: http://www.youtube.com $+ %resulturl %saystyle Title: %searchtitle %saystyle Description: %desc_be unset %searchstring unset %channel unset %saystyle unset %searchres unset %searchtitle unset %resulturl unset %desc_be unset %titlecounter unset %temp unset %foundtitle halt } if (*No Videos found* iswm %temp) { sockclose ytsearch %saystyle No videos found for %searchstring unset %searchstring unset %channel unset %saystyle unset %searchres unset %searchtitle unset %resulturl unset %desc_be unset %titlecounter unset %temp unset %foundtitle halt } if (*start search results* iswm %temp) { %searchres = 0 } if (*<a href="/watch?v=* iswm %temp) { inc %searchres } } |