Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8524277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:38:36+00:00 2026-06-11T07:38:36+00:00

I want to parse Dailymotion video url to get video id in javascript, like

  • 0

I want to parse Dailymotion video url to get video id in javascript, like below:

http://www.dailymotion.com/video/x44lvd

video id: “x44lvd”

i think i need regex string to get a video id for all dailymotion video url combinations.

i found url parser regex for YouTube links, its working well like below:

var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
    var match = url.match(regExp);
    var videoID = "";
    if (match && match[7].length == 11){
        videoID = match[7];
    }else
       alert('video not found');

can anybody please give me some advice about dailymotion?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:38:37+00:00Added an answer on June 11, 2026 at 7:38 am
    function getDailyMotionId(url) {
        var m = url.match(/^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/);
        if (m !== null) {
            if(m[4] !== undefined) {
                return m[4];
            }
            return m[2];
        }
        return null;
    }
    
    console.log(getDailyMotionId("http://www.dailymotion.com/video/x44lvd_rates-of-exchange-like-a-renegade_music"));
    console.log(getDailyMotionId("http://www.dailymotion.com/video/x44lvd"));
    console.log(getDailyMotionId("http://www.dailymotion.com/hub/x9q_Galatasaray"));
    console.log(getDailyMotionId("http://www.dailymotion.com/hub/x9q_Galatasaray#video=xjw21s"));
    console.log(getDailyMotionId("http://www.dailymotion.com/video/xn1bi0_hakan-yukur-klip_sport"));
    

    I learned some regex in the meantime.

    This is an updated version which returns an array of any dailymotion id found in a text:

    function getDailyMotionIds(str) {
        var ret = [];
        var re = /(?:dailymotion\.com(?:\/video|\/hub)|dai\.ly)\/([0-9a-z]+)(?:[\-_0-9a-zA-Z]+#video=([a-z0-9]+))?/g;     
        var m;
    
        while ((m = re.exec(str)) != null) {
            if (m.index === re.lastIndex) {
                re.lastIndex++;
            }
            ret.push(m[2]?m[2]:m[1]);
        }
        return ret;
    }
    

    test it here http://jsfiddle.net/18upkjaa/embedded/result/ by typing into the textbox

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to parse the addresses from the JSON response (http://maps.googleapis.com/maps/api/geocode/json?address=public+library+san+diego&sensor=false) received from Geocoding
I want to parse my date like yyyy-mm-dd-hh:mm:ss. And I want to get a
i want parse xml file, which does't have xml extension, like this: http://bizonek.wrzuta.pl/xml/plik/1ANdXCgTOit/unknow/undefined/643/ my
I want to parse this URL with PHP to get the latitude of a
I want to parse information in: http://feeds.informationweek.com/infoweek/news http://feeds.news.com.au/public/rss/2.0/fs_breaking_news_13.xml http://rss.cnn.com/rss/cnn_topstories.rss using php. And save the
I want to parse expressions like those in typical Haskell source. I get an
I want to parse something like this: Hi [{tagname:content}] [{tag1:xnkudfdhkfujhkdjki diidfo now nested tag
I want to parse the following xml and get the value of metadata:description using
I want to parse a JSON file in java and get the following values
I want to parse Google News RSS with PHP, to get actual links of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.