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 8598391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:08:25+00:00 2026-06-12T01:08:25+00:00

Im trying to write plugin that will catch video details from various video websites

  • 0

Im trying to write plugin that will catch video details from various video websites simply by copy and paste url from browser.

But im having problems with metacafe videos.
To fetch details from example this video url

http://www.metacafe.com/watch/cb-V9EJSvnKvTcH/confronting_fear_in_virtual_reality/

I need to go to metacafe http://www.metacafe.com/api/item/cb-V9EJSvnKvTcH/ and parse xml from this video id.

I thought it would be easy but problem is metacafe use only video id for xml data and url contains also video name after id.

To embed only video i use

$video_grab_url = 'http://www.metacafe.com/watch/cb-V9EJSvnKvTcH/confronting_fear_in_virtual_reality/';
$embed_vid_url = parse_url( $video_grab_url );
$metacafe = mb_substr( $embed_vid_url['path'], 7, -1 );

With this i get video id with name for embed.
But as i said for other details i need to parse xml data from url and to get url of xml data i need only video id without name.

Im not php pro so i got little lost in using preg_match
How do i use preg_match to get only this “cb-V9EJSvnKvTcH” so i can pull xml data and parse info like duration, thumb, tags, etc…

  • 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-12T01:08:26+00:00Added an answer on June 12, 2026 at 1:08 am

    Try this one. Maybe this can help you.

    (?<=watch/).*?(?=/)
    

    sample PHP code,

    <?php
    $subject = "theLINKhere";
    $pattern = "#(?<=watch/).*?(?=/)#"; // edit: Added modifiers
    preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3);
    print_r($matches);
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a plugin that will extend InheritedResources . Specifically I want
Im trying to write a quick plugin that will load some AJAX content into
I'm trying to write a jQuery plugin that will provide additional functions/methods to the
I am trying to write a jQuery plugin that will have similar functionality to
I'm trying to write a plugin that will make a system call which generates
I'm trying to write a custom Maven plugin that will parse the SCM changelog
I'm trying to write a custom tag plugin for Jekyll that will output a
I'm trying to write a plugin that aliases some methods in ActiveRecord in the
I'm trying to write a jQuery plugin to prevent users from typing numbers with
I am trying to write a nodejs server that will take a time input

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.