Jump to content

Recommended Posts

Hi all, hope you can help  ???

For example, if i type in a url into my browser like:

http://site.com/flashmovie/#4554354

and then my broswer redirects to a flash file in a flash player.

The address in the address bar has changed as I was redirected, this is the address I need.

Now in php, i have tried include, get, request and file get contents. All i can manage to get is the
source to the movie file or flahs player. I need the url it puts in address bar...

Any ideas??????

Thanks in advance, merry xmas
Link to comment
https://forums.phpfreaks.com/topic/31826-get-redirected-url/
Share on other sites

No, better example:

put this link into your broswer:

http://youtube.com/v/I6DBeK7y-4Q

it redirects to:

http://youtube.com/p.swf?video_id=I6DBeK7y-4Q&eurl=&iurl=http%3A//sjc-static14.sjc.youtube.com/vi/I6DBeK7y-4Q/2.jpg&t=OEgsToPDskLkdpKDXcRxIFXN6VgdQ-AN

*warning, girl booty shaking video*



I just need to be able to get that url it re-directs too
Link to comment
https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147573
Share on other sites

I do not know the system with php but javascript or if I understand you correctly, but maybe this will help or maybe not.

(http://yoururl.com/index22.php)
<script type="text/javascript" src="http://yoururl.com/index1.php"></script>

(you will see "type the script here, the location of this can be whatever" text only on the site http://yoururl.com/index22.php but the text really is located on the http://yoururl.com/index1.php site)

(http://yoururl.com/index1.php)
document.write(' type the script here, the location of this can be whatever');

but the files code must be in one code line(flash movie etc)

if you do not have access to the original file, then this does not work.

anyway, Merry Christmas

Thomas
Link to comment
https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147614
Share on other sites

[quote author=Shu link=topic=119886.msg491437#msg491437 date=1167081915]
I clicked http://youtube.com/v/I6DBeK7y-4Q

and the server send these headers that make my browser goes to another url

[code]HTTP/1.x 303 See Other
Location: /p.swf?video_id=I6DBeK7y-4Q[/code]

are u trying to get these headers?
[/quote]

Yes, well I need all of it

"/p.swf?video_id=I6DBeK7y-4Q&eurl=http%3A//www.phpfreaks.com/forums/index.php/topic%2C119886.0.html&iurl=http%3A//sjc-static14.sjc.youtube.com/vi/I6DBeK7y-4Q/2.jpg&t=OEgsToPDskKfSoIPM3Tgb0_xUqjPmh17"

did it show you all of it or just the bit you quoted?
Link to comment
https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147654
Share on other sites

[quote author=Shu link=topic=119886.msg491445#msg491445 date=1167083198]
i cut off part of it cause it contain some personal info
[/quote]

Ok, did it look like this though?

[code]"/p.swf?video_id=I6DBeK7y-4Q&eurl=http%3A//www.phpfreaks.com/forums/index.php/topic%2C119886.0.html&iurl=http%3A//sjc-static14.sjc.youtube.com/vi/I6DBeK7y-4Q/2.jpg&[b]t=OEgsToPDskKfSoIPM3Tgb0_xUqjPmh17[/b]"[/code]

And have t=blahblahwhatever on the end??? if so, do you know how to do this in php?? thanks
Link to comment
https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147660
Share on other sites

[quote author=Shu link=topic=119886.msg491448#msg491448 date=1167083778]
so u want to write a script that redirect user to another url?

or u want to access a website and read their headers?
[/quote]


All I want, is to be able to get the url that this link directs too:

http://youtube.com/v/I6DBeK7y-4Q

it directs to

http://youtube.com/p.swf?video_id=I6DBeK7y-4Q&eurl=&iurl=http%3A//sjc-static14.sjc.youtube.com/vi/I6DBeK7y-4Q/2.jpg&t=OEgsToPDskIDNtK1GcrDtb2oPUlepC__



Thats exactly what I need to be able to do. Obviosly the link will change etc, but it always redirects in the same mannor.


Link to comment
https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147663
Share on other sites

I really dont know how I can be any clearer. Ok i'll explain it from start but all my posts are starting to look the same.

Ok the reason is for a php program I am writing, well updating... to download youtube videos.

A normal youtube video link looks like this:
http://youtube.com/watch?v=-fjTlpuEzkA

But to download a video you have to request it with an ID for that video. Now, I can do this but with my current program, some videos cant be downloaded due to them being flagged down, etc.

Today after much messing and reading video pages sources, I realised that if you go to
http://youtube.com/v/
(with the video hash (not ID) on the end, like this http://youtube.com/v/-fjTlpuEzkA)

It re-directs you to another address and the video starts to play, this address looks like this:
http://youtube.com/p.swf?video_id=-fjTlpuEzkA&eurl=&iurl=http%3A//sjc-static11.sjc.youtube.com/vi/-fjTlpuEzkA/2.jpg&t=OEgsToPDskIF4Dbbyub_qD2zoypSsLwi

*again, I have said this 2/3 times now  :-\*

Ok now on that link right at the end is the information I need to download the video: "t=OEgsToPDskIF4Dbbyub_qD2zoypSsLwi"



So, again  ::) I just need that address it re-directs too because it has information needed to download the video in it.


Hope thats clear.


Link to comment
https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147669
Share on other sites

If you had checked out the link i gave you
it redirects this:
http://www.gentlesource.com/demos/demo-short-url-script/?XVGRW

to the link of the page (*the current page you are viewing right NOW!)

by the endding of the url: ?XVGRW I dont see why this does not match what you want

If you dont believe me, just try the link.
Link to comment
https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147673
Share on other sites

[quote author=ted_chou12 link=topic=119886.msg491460#msg491460 date=1167087156]
If you had checked out the link i gave you
it redirects this:
http://www.gentlesource.com/demos/demo-short-url-script/?XVGRW

to the link of the page (*the current page you are viewing right NOW!)

by the endding of the url: ?XVGRW I dont see why this does not match what you want

If you dont believe me, just try the link.
[/quote]

What the hell? did you even read what I wrote. That link you sent me is no good for my php program
Link to comment
https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147674
Share on other sites

[quote author=ted_chou12 link=topic=119886.msg491463#msg491463 date=1167087795]
okay, then my best advice is why dont you go and contact the admin for youtube? wouldnt that give the best solution???
[/quote]

They dont reply. Look, if you dont have an answer thats ok.. you cant know it all. Theres no point giving me links that do nothing what I asked and keep asking me the same thing. My question is very easy to understand, maybe not easy to do but yeh. I would just like to be told if this can be done and stepped in the right direction. I am very new to php and have tried a few silly things like file_get_contents and including the url and checking the current url etc, all no good. I dont have the knowledge yet hence asking here. Hope somebody can help, surely this cant be impossible? considering the information i need puts itself into my address bar infront of my face, it must be possible
Link to comment
https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147677
Share on other sites

okay then, if the url address is sitting in front of you, it must be possible, yes then. If it is possible, contacting the admin would be the best idea, if they dont reply, then i guess you have to give up, because as the current situation states, the people in this forum is not so much of an expert as to those vedio freaks.
BTW, writing a program to download youtube vedio sounds really really dumb believe me, anyone who hears it is gonna laugh at you like i do, besides automatic downloading can cause risks to viruses. And afterall, whats the difference between a redirected link and the original link?
Link to comment
https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147680
Share on other sites

You click on movie_test.php you goto movie_result.php
and then redirected to show_movies.php and i have added letters to show on the url for show lol.

As you can see this is an example of the header function and you need to add all the database information.

movie test.php

[code]

<?php
$movie_name="php is god lol";
$movie_id="0001";
?>
<table border="4" bordercolor="black">
<tr>
<td>
movie name
<br>
<?php echo $movie_name;?>
<br>
<a href="movie_result.php?movie_id=<?php echo $movie_id;?>">click me to see movie</a>
</tr>
</td>
</table>

[/code]




movie_result.php

[code]

<?php

if($_GET['movie_id']=="0001"){

$movie_id=$_GET['movie_id'];

$letters="dfrnlhoynfmdkeovnfr_pb";

header("location: show_movie.php?$letters&movie_id=$movie_id");
}

?>
[/code]


show_movie.php

[code]

<?php

if($_GET['movie_id']=="0001"){

$movie_id=$_GET['movie_id'];

echo "movie is playing";

}else{

echo "movie is not playing";

}

?>

[/code]
Link to comment
https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147833
Share on other sites

[quote author=ted_chou12 link=topic=119886.msg491468#msg491468 date=1167088841]
okay then, if the url address is sitting in front of you, it must be possible, yes then. If it is possible, contacting the admin would be the best idea, if they dont reply, then i guess you have to give up, because as the current situation states, the people in this forum is not so much of an expert as to those vedio freaks.
BTW, writing a program to download youtube vedio sounds really really dumb believe me, anyone who hears it is gonna laugh at you like i do, besides automatic downloading can cause risks to viruses. And afterall, whats the difference between a redirected link and the original link?
[/quote]

You laugh because you are ignorant, if you did a bit of reading you would find out that 4.2 million emails were sent to youtube asking "how do i download your movies!!" - alot of people have wrote youtube downloaders, infact some are making a fortune from the ads on that actual page. Not so funny anymore is it. Anyway I have came up with this new way of doing it which would rule out all problems, but as shown nobody can think of away to do it.

redarrow; i see that but thats php files, the link im going to isnt a file infact i think its a dir which redirects to a flash player with a video.
Link to comment
https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147868
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.