1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Simulate Javascript Redirect

Discussion in 'JavaScript' started by ColorWP.com, Feb 4, 2012.

  1. #1
    The following site is bugging me in my attempts to grab the video titles:
    http://vbox7.com

    Whenever you visit a video page with JavaScript (or cookies, but I figured a way to simulate them on) turned off you can not see the video title.

    A typical video page: http://vbox7.com/play:fd7caa326b

    If visited without Javascript the page is redirected to::
    http://vbox7.com/show:missjavascript?back_to=%2Fplay%3Afd7caa326b
    Code (markup):
    Now I want to grab this video title and I am using PHP+cURL.
    First I grab the video page with cURL and I naturally get the "JS not enabled" page source. It contains code similar to this:
    <script type="text/javascript">
    	window.location = '?js=1&token=84c6ba94f8&back_to=%2Fplay%3Afd7caa326b';
    </script>
    Code (markup):
    I then try to go to grab this page:
    http://vbox7.com/?js=1&token=230dd03921&back_to=%2Fplay%3Aa5193686a6
    Code (markup):
    I fake the referrer to be the original video play URL and I simulate a Mozilla Firefox user agent.

    However, in the end I still get the same page which says that Javascript is disabled. Only this time, the page has this redirection Javascript:
    <script type="text/javascript">
    	window.location = '?js=1&token=22becb732e&back_to=%2F%3Fjs%3D1%26token%3D22becb732e%26back_to%3D%252Fplay%253Aa5193686a6';
    </script>
    Code (markup):
    Essentially, an infinite loop...

    Do you know how to solve this issues - e.g. how to skip the Javascript check or grab the video title in another manner?

    My full code is this:
     
    ColorWP.com, Feb 4, 2012 IP
  2. lotusin1

    lotusin1 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If the some javascripts is download to execute on local computer and send back the "result" to server. you need to simulate the local computer to get the result of javascripts' execution.
     
    lotusin1, Feb 6, 2012 IP
  3. ColorWP.com

    ColorWP.com Notable Member

    Messages:
    3,104
    Likes Received:
    98
    Best Answers:
    1
    Trophy Points:
    205
    #3
    No, I believe it doesn't work with this concept. Besides, I don't think JavaScript has enough permissions to initiate a download without the user's consent.
     
    ColorWP.com, Feb 10, 2012 IP