kheldor | 06 Temmuz 2013 07:14 | Cevap: youtube tcl Sevgili Abdullahın yayınladığı kod sanırım sitedeki değişiklikler yüzünden sekteye uğramış ve
[07:12:18] <@BT> YouTube Sonuçları
[07:12:18] <@BT> Aradığınız kelimelerle ilgili hiç video bulunamadı
şeklinde hata vermekte. Hata tam olarak nerede . Sevgiler. PHP- Kodu: ############################################################################## # youtube.tcl by SaW # ############################################################################## # Normal Kullanım : # # !youtube <aranacak-kelimeler> # # Örnek : !youtube komik videolar # # # # Parametreli Kullanım : # # !youtube <parametre> <aranacak-kelimeler> # # # # Mevcut Parametreler: # # -nN : Kaç tane sonucun görüntüleneceğini belirler. # # Örnek : !youtube -n8 komik videolar # # # # -tN : Arama sonuçlarının neye göre sıralacağını belirler : # # N=1 : Normal Sıralama, N=2 : izlenme sayısına göre # # N=3 : Rating sıralaması, N=4 : Video ekleme tarihine göre sıralar. # # Örnek : !youtube -t2 komik videolar # ############################################################################## # 16 Aralık 2008 Salı # # iletişim: abdullah_tas[MENTION=108470]Mynet[/MENTION].com # ##############################################################################
# ## Komutun çalışmasını istediğiniz kanalları aralarına boşluk koyarak belirtiniz. # set you(kanal) "#belirli"
# ## Arama sonrasında kaç sonucunun ekrana yansıtılacağını seçiniz. # set you(maxc) 5
# ## Sonuçların neye göre sıralanacağını seçiniz. ## 1= Normal sıralama ## 2= İzlenme sayısına göre ## 3= Rating oranına göre ## 4= Eklenme tarihine göre # set you(sertype) 1
############################################################################### # BURADAN SONRASINA DOKUNMAYINIZ!!!! # ###############################################################################
bind pub - !youtube ytb
if {$you(sertype) == 1} { set you(stype) "" } if {$you(sertype) == 1} { set you(stype) "&search_sort=video_view_count" } if {$you(sertype) == 1} { set you(stype) "&search_sort=video_avg_rating" } if {$you(sertype) == 1} { set you(stype) "&search_sort=video_date_uploaded" }
bind pub - !you ytb proc ytb {nick uhost hand chan text} { global you if {[lsearch -exact $you(kanal) $chan] == -1} {return 0} set searchtype $you(stype) set text [split [string trim $text]] if {$text == ""} {putquick "PRIVMSG $chan :\002Aranacak kelimeyi girmediniz.";return} if {[llength $text] == 1 && [string match -nocase "$text" help]} { putquick "privmsg $chan :\002You\0030,4Tube\002\003 Arama şekilleri" putquick "privmsg $chan :\0032Normal arama :\003 !youtube <aranacak-kelimeler>" putquick "privmsg $chan :\0032Parametreli arama :\003 !youtube <parametre> <aranacak-kelimeler>" putquick "privmsg $chan :\002Mevcut Parametreler:" putquick "privmsg $chan :\0032-nN :\003 Kaç tane sonucun görüntüleneceğini belirler. Örnek : !youtube -n8 komik videolar" putquick "privmsg $chan :\0032-tN :\003 Arama sonuçlarının neye göre sıralanacağını belirler :" putquick "privmsg $chan :N=1 : Normal Sıralama, N=2 : izlenme sayısına göre, N=3 : Rating sıralaması, N=4 : Video ekleme tarihine göre sıralar." putquick "privmsg $chan :Örnek : !youtube -t2 komik videolar" return 0 } if {[llength $text] >= 2 && [string match -nocase "-n" [string range [lindex $text 0] 0 1]] && [string length [lindex $text 0]] > 2 && [string length [lindex $text 0]] <= 4 && [string is integer [string range [lindex $text 0] 2 end]] == 1} { set cmax [string range [lindex $text 0] 2 end] ; set text [lrange $text 1 end] } else { set cmax $you(maxc) } if {[llength $text] >= 2 && [string match -nocase "-t" [string range [lindex $text 0] 0 1]] && [string length [lindex $text 0]] == 3 && [string length [lindex $text 0]] <= 4 && [string is integer [string range [lindex $text 0] 2 end]] == 1} { if {[string index [lindex $text 0] 2] == 1} { set searchtype "" ; set text [lrange $text 1 end] } elseif {[string index [lindex $text 0] 2] == 2} { set searchtype "&search_sort=video_view_count" ; set text [lrange $text 1 end] } elseif {[string index [lindex $text 0] 2] == 3} { set searchtype "&search_sort=video_avg_rating" ; set text [lrange $text 1 end] } elseif {[string index [lindex $text 0] 2] == 4} { set searchtype "&search_sort=video_date_uploaded" ; set text [lrange $text 1 end] } else { set searchtype $you(stype) ; set text [lrange $text 1 end] } } if {[llength $text] > 1} {set text [join [split $text " "] +]} set text [string tolower $text 0 end] putlog "$text" if {$searchtype == ""} { set yousite " Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir. style="color: #0000BB">$text" } elseif {$searchtype != ""} { set yousite " Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir. style="color: #0000BB">$text$searchtype" } set sayfa "" catch {set sayfa [::http::geturl $yousite -timeout 3000]} error if {[string match -nocase "*couldn't open socket*" $error]} { putquick "PRIVMSG $chan :Hata: Şuan siteye bağlanılamıyor.. Daha Sonra Tekrar Deneyiniz.." ::http::cleanup $sayfa return } if { [::http::status $sayfa] == "*timeout*" } { putquick "PRIVMSG $chan :Hata: YouTube'a bağlantı zaman aşımına uğradı.." ::http::cleanup $sayfa return } set html [::http::data $sayfa] ::http::cleanup $sayfa you:temiz $html set count 1 putquick "privmsg $chan :\002You\0030,4Tube\002\003 Sonuçları" foreach y [split $html \n] { if {[string match -nocase "*id=\"video-url-*" $y] && $count <= $cmax} { regexp -- {id=\"video-url-(.*?)\".href=\"/watch.+<img.title=\"(.*?)\"} $y - shr title } if {[info exists shr]} { if {[string match -nocase "*video-run-time-$shr*" $y] && $count <= $cmax} { regexp -- {video-run-time-...........\">(.*?)<} $y - uzn } } if {[info exists shr] && [info exists uzn]} { if {[string match -nocase "*video-date-added*" $y] && $count <= $cmax} { regexp -- {video-date-added\">(.*?)<} $y - added } } if {[info exists shr] && [info exists uzn] && [info exists added]} { if {[string match -nocase "*video-view-count*" $y] && $count <= $cmax} { regexp -- {video-view-count\">(.*?)views<} $y - view putquick "privmsg $chan :$count -\002\0035 $title" putquick "privmsg $chan :Eklenme zamanı:\0036 $added \003izlenme:\0036 $view \003Uzunluk:\0036 $uzn" putquick "privmsg $chan :\00314http:// Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir. style="color: #0000BB">putquick "privmsg $chan : " incr count
} }
} if {$count == 1} { putquick "privmsg $chan :Aradığınız kelimelerle ilgili hiç video bulunamadı" } }
proc you:temiz {html} { regsub -all {\t} $html {} html regsub -all { } $html {} html regsub -all {&} $html {&} html regsub -all {\u015E} $html {Ş} html regsub -all {\u015F} $html {ş} html regsub -all {\u011F} $html {ğ} html regsub -all {\u011E} $html {Ğ} html regsub -all {\u0131} $html {ı} html regsub -all {\u0130} $html {İ} html regsub -all {Ç} $html {C} html return $html }
putlog "youtube.tcl By SaW Başarıyla Yüklendi"
|