X
X
Xrist1An2015-04-03 13:11:47
PHP
Xrist1An, 2015-04-03 13:11:47

How to pull the contents of the script tag?

How to pull out using simple_html_dom from the following code:

<script type="text/javascript">
    var urlVideoApiGetStreamUrl = '/api/video/get-stream-url?videoId=10048',
      videoPlayerOptions = {
        'playerId'      : 'player0',
        'primary'       : 'html5',
        'videoId'       : 10048,
        'streamTtl'     : 1800,
        'autostart'     : '' === '1',
        'skin'          : 'http://static3.domain.com/xml/defaultSkin.xml?v=634495daa592',
        'flashPlayer'   : 'http://static2.domain.com/flash/jwplayer.flash.swf?v=7ee91d120553',
        'html5Player'   : 'http://static1.domain.com/js/min/vendor/jwplayer.html5.js?v=c7e4c2ea4baf',
        'poster'        : 'http://image3.vod.domain.com/223/1EkRqtAnKS/1280x720/13.jpg',
        'isEmbed'       : '1' === '1',
        'hdLink'        : 'http://www.prime.com/user/signup?utm_source=pornhd.com&utm_medium=hdButton&utm_campaign=Prime',
        'sources'       : {
          '240p'  : 'http://37.48.126.41/223/1EkRqtAnKS/video.mp4?sh=3BF3KvJLTMOLGqJ-oDfD3A&ttl=1428059331',
          '480p'  : 'http://37.48.126.41/223/1EkRqtAnKS/video_hq.mp4?sh=3IPBRrjC3e0HjdjzkwMixA&ttl=1428059331',
          '720p'  : '',
          '1080p' : ''
        }
      },
      mainPlayer;

      mainPlayer = new VideoPlayerEmbed(videoPlayerOptions);
    </script>

pull these out:
http://37.48.126.41/223/1EkRqtAnKS/video.mp4?sh=3BF3KvJLTMOLGqJ-oDfD3A&ttl=1428059331
http://37.48.126.41/223/1EkRqtAnKS/video_hq.mp4?sh=3IPBRrjC3e0HjdjzkwMixA&ttl=1428059331

links?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
He11ion, 2015-04-03
@He11ion

Pull out the tag and parse the string with regular expressions. Or immediately parse the text, without translating it into an object, it will be faster.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question