Jump to content

MyTube Script Problem.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
tubememory

tubememory

    Newbie

  • Members
  • Pip
  • 5 posts
I downloaded MyTube script from <URL REMOVED> and installed it on my site <URL REMOVED>

That script can search and download youtube videos.

Now I have a problem, when I enter a search query with more than one word (eg: Red Rose) it gives an error, see >> <URL REMOVED>

But if I enter single query (single word) >> "Rose" >> <URL REMOVED> it woking fine.

Why is that ? can anyone help me to fix this problem, you can download that simple script from <URL REMOVED>

Edited by Jordan, 07 July 2009 - 04:27 AM.


#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
You'll have to provide us with the code. Especially the code on and around line 20 of base.php.

#3
tubememory

tubememory

    Newbie

  • Members
  • Pip
  • 5 posts
As i'm new to this forum, forum doesnot allow me to post links.
You can get the PHP code of "base.php" via below URL (As a txt file).

Pls delete unneccessary spaces in the below URL.

<URL REMOVED>

Edited by Jordan, 07 July 2009 - 04:27 AM.
URL


#4
Guest_Jordan_*

Guest_Jordan_*
  • Guests
The first thing you should do is change error_reporting(0) to error_reporting(E_ALL) while debugging this script. I wrote a tutorial on debugging with PHP here, if you are interested.

Secondly, the code throwing the error is here:

	$ytdata = fetchrss("http://gdata.youtube.com/feeds/videos?vq=$ytsearch&start-index=1&max-results=50");
	if(!(xml_parse($ytxml_parser, $ytdata)))
		die("Error on line " . xml_get_current_line_number($ytxml_parser));

I suspect it is something to do with the $ytsearch variable. It may have something to do with your formatting:

$searchterms = addslashes(trim(str_replace(" ","+",$_GET['search'])));
$searchterms = addslashes(trim(str_replace("-","+",$_GET['search'])));
$searchterms2 = ucwords(str_replace("+"," ",$searchterms));

You should echo out $ytsearch before you use it to build the URL string and see what it looks like. Or better, echo the URL string out and see if you can access it in your browser.

#5
tubememory

tubememory

    Newbie

  • Members
  • Pip
  • 5 posts
Thank you for replying, but i'm not a hard coder.

if you can pls download the original source code given below and fix the problem and tell it to me, and it has only few PHP file No Database required, only few PHP files.

Here is the download location of my original source code:

<URL REMOVED>

Edited by Jordan, 07 July 2009 - 04:28 AM.