dailymotion

select category whileuploading videos

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        dailymotion
// @namespace   dailymotion
// @description select category whileuploading videos
// @include     http://www.dailymotion.com/*
// @version     1
// @grant       none
// ==/UserScript==


// here is category variable where you can put your required category value
var category = "fun";  // for Celeb

//and here are available categories values you can choose from
//<option value="" selected="selected"></option>
//<option value="animals">Animals</option>
//<option value="auto">Auto-Moto</option>
//<option value="people">Celeb</option>
//<option value="fun">Comedy & Entertainment</option>
//<option value="webcam">Community & Blogs</option>
//<option value="creation">Creative</option>
//<option value="school">Education</option>
//<option value="videogames">Gaming</option>
//<option value="lifestyle">Lifestyle & How-to</option>
//<option value="shortfilms">Movies</option>
//<option value="music">Music</option>
//<option value="news">News</option>
//<option value="sport">Sports</option>
//<option value="tv">TV</option>
//<option value="tech">Tech</option>
//<option value="travel">Travel</option>


// here we are going to put intervale so every 3 second this script will run when you are on dailymotion site
setInterval(function(){ 

// here we are checking if there is category dropdown available. "user_category" is id of category dropdown
var elementExists = document.getElementById("user_category");
if(elementExists){
  
  // here we are checking whether the required category has been selected or not. if elementExists.selectedIndex == 0 means
  // category has not been selected
  if(elementExists.selectedIndex == 0)
    {
  // here we are getting all available options in dropdown
      var options= document.getElementById('user_category').options;
    
	
      for (var i= 0; i< options.length; i++) {
        
      // here we are looping and checking our required option and selecting it
        if (options[i].value == category) {
           elementExists.selectedIndex = i;
      
        }
      
      }
   }
  
}


}, 3000);