mynamesleo Posted December 25, 2006 Share Posted December 25, 2006 Hi all, hope you can help ???For example, if i type in a url into my browser like:http://site.com/flashmovie/#4554354and 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 thesource to the movie file or flahs player. I need the url it puts in address bar...Any ideas??????Thanks in advance, merry xmas Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/ Share on other sites More sharing options...
mendoz Posted December 25, 2006 Share Posted December 25, 2006 Are you trying to get the video's id through the address?if your page is: video.php?video=445566you could get that value with:[code]<?php $video=$_GET["video"]; ?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147571 Share on other sites More sharing options...
mynamesleo Posted December 25, 2006 Author Share Posted December 25, 2006 No, better example:put this link into your broswer:http://youtube.com/v/I6DBeK7y-4Qit 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 Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147573 Share on other sites More sharing options...
mendoz Posted December 25, 2006 Share Posted December 25, 2006 Are you trying to put a youtube video on your site or do something similar? Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147613 Share on other sites More sharing options...
receiver Posted December 25, 2006 Share Posted December 25, 2006 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 ChristmasThomas Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147614 Share on other sites More sharing options...
ted_chou12 Posted December 25, 2006 Share Posted December 25, 2006 go find a script called shorturl, type it in google... Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147615 Share on other sites More sharing options...
ted_chou12 Posted December 25, 2006 Share Posted December 25, 2006 or here, i have it... ;D[attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147617 Share on other sites More sharing options...
ted_chou12 Posted December 25, 2006 Share Posted December 25, 2006 try the demo here, is cool. but hard to learn...http://www.gentlesource.com/short-url-script/ Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147618 Share on other sites More sharing options...
mynamesleo Posted December 25, 2006 Author Share Posted December 25, 2006 ted_chou12, no thats not any help but thanks.receiver, didnt work either. Thanks thoughIts driving me nuts, i mean i put that link in my broswer and boom it changes to the link i need. Surely this can be done in programming Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147633 Share on other sites More sharing options...
Shu Posted December 25, 2006 Share Posted December 25, 2006 I clicked http://youtube.com/v/I6DBeK7y-4Qand the server send these headers that make my browser goes to another url[code]HTTP/1.x 303 See OtherLocation: /p.swf?video_id=I6DBeK7y-4Q[/code]are u trying to get these headers? Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147650 Share on other sites More sharing options...
mynamesleo Posted December 25, 2006 Author Share Posted December 25, 2006 [quote author=Shu link=topic=119886.msg491437#msg491437 date=1167081915]I clicked http://youtube.com/v/I6DBeK7y-4Qand the server send these headers that make my browser goes to another url[code]HTTP/1.x 303 See OtherLocation: /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? Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147654 Share on other sites More sharing options...
Shu Posted December 25, 2006 Share Posted December 25, 2006 i cut off part of it cause it contain some personal info Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147658 Share on other sites More sharing options...
mynamesleo Posted December 25, 2006 Author Share Posted December 25, 2006 [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 Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147660 Share on other sites More sharing options...
Shu Posted December 25, 2006 Share Posted December 25, 2006 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 Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147661 Share on other sites More sharing options...
mynamesleo Posted December 25, 2006 Author Share Posted December 25, 2006 [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-4Qit directs tohttp://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. Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147663 Share on other sites More sharing options...
ted_chou12 Posted December 25, 2006 Share Posted December 25, 2006 I dont see why short url script doesnt do what you want, so you dont want question marks at all? or can you please tell us the purpose, (why do you want this) what format, for what program, so we know what you need!Ted Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147666 Share on other sites More sharing options...
mynamesleo Posted December 25, 2006 Author Share Posted December 25, 2006 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=-fjTlpuEzkABut 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. Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147669 Share on other sites More sharing options...
ted_chou12 Posted December 25, 2006 Share Posted December 25, 2006 If you had checked out the link i gave youit redirects this:http://www.gentlesource.com/demos/demo-short-url-script/?XVGRWto 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 wantIf you dont believe me, just try the link. Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147673 Share on other sites More sharing options...
mynamesleo Posted December 25, 2006 Author Share Posted December 25, 2006 [quote author=ted_chou12 link=topic=119886.msg491460#msg491460 date=1167087156]If you had checked out the link i gave youit redirects this:http://www.gentlesource.com/demos/demo-short-url-script/?XVGRWto 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 wantIf 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 Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147674 Share on other sites More sharing options...
ted_chou12 Posted December 25, 2006 Share Posted December 25, 2006 okay, then my best advice is why dont you go and contact the admin for youtube? wouldnt that give the best solution??? Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147675 Share on other sites More sharing options...
mynamesleo Posted December 25, 2006 Author Share Posted December 25, 2006 [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 Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147677 Share on other sites More sharing options...
ted_chou12 Posted December 25, 2006 Share Posted December 25, 2006 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 Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147680 Share on other sites More sharing options...
Shu Posted December 26, 2006 Share Posted December 26, 2006 do u even have knowledge on http headers?also post what u have coded so other people can continue from there Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147813 Share on other sites More sharing options...
redarrow Posted December 26, 2006 Share Posted December 26, 2006 You click on movie_test.php you goto movie_result.phpand 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]<?phpif($_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]<?phpif($_GET['movie_id']=="0001"){ $movie_id=$_GET['movie_id'];echo "movie is playing";}else{echo "movie is not playing";}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147833 Share on other sites More sharing options...
mynamesleo Posted December 26, 2006 Author Share Posted December 26, 2006 [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. Quote Link to comment https://forums.phpfreaks.com/topic/31826-get-redirected-url/#findComment-147868 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.