Jump to content
UBot Underground

What Am I Doing Wrong


Recommended Posts

Hello,

 

This was the original command to scrape youtube API which used to work before youtube decided to stop API-2.Although I replaced http://gdata.youtube.com/feeds/api/videoswith "https://www.googleapis.com/youtube/v3" even that didn't help to scrape the titles, views,likes and comments.

I guess its more of problem with youtube API than regular expression used here.

 

 

 

define GET VIDEO TITLE {
    set
(#logtext
,"[{$find regular expression($date,"\\d+:\\d+:\\d+")}]Getting title, views, likes and comments of video: {$plugin function("LocalDictionary.dll", "$local dictionary get", "video id")}<br>","Global")
    navigate("http://gdata.youtube.com/feeds/api/videos/{$ /{$plugin function("LocalDictionary.dll", "$local dictionary get", "video id")}?v=2&alt=json","Wait")
    save to file("C:\\1.csv.txt",$document text)
    plugin command("LocalDictionary.dll", "local dictionary add", "video html", $document text)
    plugin command("LocalDictionary.dll", "local dictionary add", "video title", $find regular expression($plugin function("LocalDictionary.dll", "$local dictionary get", "video html"),"(?<=\"title\":\\\{\"\\$t\":\").*?(?=\")"))
    set table cell(&table,$plugin function("LocalDictionary.dll", "$local dictionary get", "thread row"),2,"<td>{$plugin function("LocalDictionary.dll", "$local dictionary get", "video title")}</td>")
    plugin command("LocalDictionary.dll", "local dictionary add", "views", $replace($find regular expression($plugin function("LocalDictionary.dll", "$local dictionary get", "video html"),"(?<=viewCount\":\").*?(?=\")"),".",""))
    plugin command("LocalDictionary.dll", "local dictionary add", "likes", $replace($find regular expression($plugin function("LocalDictionary.dll", "$local dictionary get", "video html"),"(?<=\"numLikes\":\").*?(?=\")"),".",""))
    plugin command("LocalDictionary.dll", "local dictionary add", "comments", $find regular expression($plugin function("LocalDictionary.dll", "$local dictionary get", "video html"),"(?<=\"countHint\":)\\d+"))
    set table cell(&table,$plugin function("LocalDictionary.dll", "$local dictionary get", "thread row"),4,"<td>{$plugin function("LocalDictionary.dll", "$local dictionary get", "views")}</td>")
    set table cell(&table,$plugin function("LocalDictionary.dll", "$local dictionary get", "thread row"),5,"<td>{$plugin function("LocalDictionary.dll", "$local dictionary get", "likes")}</td>")
    set table cell(&table,$plugin function("LocalDictionary.dll", "$local dictionary get", "thread row"),6,"<td>{$plugin function("LocalDictionary.dll", "$local dictionary get", "comments")}</td>")
}
 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...