예제 #1
0
    def _get_archive_videos(self, type, game_name, date, sort_by,genre_id, system_id):   
        query = '?search=&type=%s&time=%s&sort=%s' % (type, date, sort_by)
        
        if system_id:
            query += '&system=%d' % system_id
        
        if game_name:
            query += '&search_game=%s' % game_name

        if genre_id:
            query += '&genre_id=%d' % genre_id

        raw_data = self.get_response_data(self.LIST_ARCHIVE_URL + query)
        xml_doc = utils.build_xml_tree(raw_data)
        items = utils.do_xpath_query(xml_doc, '//item')
        return self.build_stream_object_list(items) 
예제 #2
0
    def _get_archive_videos(self, type, game_name, date, sort_by, genre_id,
                            system_id):
        query = '?search=&type=%s&time=%s&sort=%s' % (type, date, sort_by)

        if system_id:
            query += '&system=%d' % system_id

        if game_name:
            query += '&search_game=%s' % game_name

        if genre_id:
            query += '&genre_id=%d' % genre_id

        raw_data = self.get_response_data(self.LIST_ARCHIVE_URL + query)
        xml_doc = utils.build_xml_tree(raw_data)
        items = utils.do_xpath_query(xml_doc, '//item')
        return self.build_stream_object_list(items)
예제 #3
0
    def get_rtmp_url(self, stream_id):
        '''
            possible rtmp servers
            rtmp://own3duslivefs.fplive.net/own3duslive-live <- almost never
            rtmp://own3deulivefs.fplive.net/own3deulive-live <- almost never

            rtmp://fml.2010.edgecastcdn.net:1935/202010 <- pretty stable.
            rtmp://owned.fc.llnwd.net:1935/owned <- pretty stable.
            
            problem is masked servers (${cdn1}, ${cdn2}), right now just
            guessing on one random edgecast cdn
            
            could probably retry on all known servers, but that would be really
            slow.
            
            from http://bogy.mine.nu/sc2/stream2vlc.php , with channel id :
                33356 (chaox) , hoster : own3d.tv
            "C:\rtmpdump-2.3\rtmpdump.exe" 
                -r "rtmp://own3duslivefs.fplive.net/own3duslive-live" 
                -f "WIN 11,1,102,55" 
                -W "http://static.ec.own3d.tv/player/Own3dPlayerV2_86.swf" 
                -p "http://www.own3d.tv/live/33356" 
                --live 
                -y "own3d.aonempatic_33356"
            
            -r|--rtmp     url     URL (e.g. rtmp://host[:port]/path)
            -f|--flashVer string  Flash version string (default: "WIN 10,0,32,18")
            -W|--swfVfy   url     URL to player swf file, compute hash/size automatically
            -p|--pageUrl  url     Web URL of played programme
            -v|--live             Save a live stream, no --resume (seeking) of live streams possible
            -y|--playpath path    Overrides the playpath parsed from rtmp url
        '''
        raw_data = self.get_response_data(self.LIVE_STREAM_CONFIG_URL %
                                          stream_id)
        xml_doc = utils.build_xml_tree(raw_data)

        channel = utils.do_xpath_query(xml_doc, '//channel')[0]
        item = utils.do_xpath_query(channel, '//item')[0]
        stream_item = utils.do_xpath_query(item, '//stream')[0]

        rtmp = item.attrib.get('base')

        # override if unknown
        if '${cdn1}' in rtmp:
            rtmp = 'rtmp://fml.2010.edgecastcdn.net:1935/202010'
        elif '${cdn2}' in rtmp:
            rtmp = 'rtmp://owned.fc.llnwd.net:1935/owned'

        #flashVer = 'WIN 11,1,102,55'
        #swfVfy   = 'http://static.ec.own3d.tv/player/Own3dPlayerV2_86.swf'
        pageUrl = 'http://www.own3d.tv/live/%d' % stream_id
        #live     = 'True'
        playpath = stream_item.attrib.get('name')

        stream_url = '%s pageUrl=%s Playpath=%s swfUrl=http://static.ec.own3d.tv/player/Own3dPlayerV2_86.swf swfVfy=True Live=True' % (
            rtmp, pageUrl, playpath)

        stream_object = StreamObject()
        stream_object.title = channel.attrib.get('name')
        stream_object.game = channel.attrib.get('description')
        stream_object.description = channel.attrib.get('description')
        stream_object.stream_id = stream_id
        stream_object.rtmp_url = stream_url

        return stream_object
예제 #4
0
 def get_live_streams(self, game):
     raw_data = self.get_response_data(self.LIST_LIVE_STREAMS_URL)
     xml_doc = utils.build_xml_tree(raw_data)
     items = utils.do_xpath_query(xml_doc,
                                  '//item[misc[@game = "%s"]]' % game)
     return self.build_stream_object_list(items)
예제 #5
0
    def get_rtmp_url(self, stream_id):
        '''
            possible rtmp servers
            rtmp://own3duslivefs.fplive.net/own3duslive-live <- almost never
            rtmp://own3deulivefs.fplive.net/own3deulive-live <- almost never

            rtmp://fml.2010.edgecastcdn.net:1935/202010 <- pretty stable.
            rtmp://owned.fc.llnwd.net:1935/owned <- pretty stable.
            
            problem is masked servers (${cdn1}, ${cdn2}), right now just
            guessing on one random edgecast cdn
            
            could probably retry on all known servers, but that would be really
            slow.
            
            from http://bogy.mine.nu/sc2/stream2vlc.php , with channel id :
                33356 (chaox) , hoster : own3d.tv
            "C:\rtmpdump-2.3\rtmpdump.exe" 
                -r "rtmp://own3duslivefs.fplive.net/own3duslive-live" 
                -f "WIN 11,1,102,55" 
                -W "http://static.ec.own3d.tv/player/Own3dPlayerV2_86.swf" 
                -p "http://www.own3d.tv/live/33356" 
                --live 
                -y "own3d.aonempatic_33356"
            
            -r|--rtmp     url     URL (e.g. rtmp://host[:port]/path)
            -f|--flashVer string  Flash version string (default: "WIN 10,0,32,18")
            -W|--swfVfy   url     URL to player swf file, compute hash/size automatically
            -p|--pageUrl  url     Web URL of played programme
            -v|--live             Save a live stream, no --resume (seeking) of live streams possible
            -y|--playpath path    Overrides the playpath parsed from rtmp url
        '''
        raw_data = self.get_response_data(self.LIVE_STREAM_CONFIG_URL % stream_id)
        xml_doc = utils.build_xml_tree(raw_data)

        channel = utils.do_xpath_query(xml_doc, '//channel')[0]
        item = utils.do_xpath_query(channel, '//item')[0]
        stream_item = utils.do_xpath_query(item, '//stream')[0]

        rtmp = item.attrib.get('base')
        
        # override if unknown
        if '${cdn1}' in rtmp:
            rtmp = 'rtmp://fml.2010.edgecastcdn.net:1935/202010'
        elif '${cdn2}' in rtmp:
            rtmp = 'rtmp://owned.fc.llnwd.net:1935/owned'
        
        #flashVer = 'WIN 11,1,102,55'
        #swfVfy   = 'http://static.ec.own3d.tv/player/Own3dPlayerV2_86.swf'
        pageUrl  = 'http://www.own3d.tv/live/%d' % stream_id
        #live     = 'True'
        playpath = stream_item.attrib.get('name')
        
        stream_url = '%s pageUrl=%s Playpath=%s swfUrl=http://static.ec.own3d.tv/player/Own3dPlayerV2_86.swf swfVfy=True Live=True' % (rtmp, pageUrl, playpath)
        
        stream_object = StreamObject()
        stream_object.title = channel.attrib.get('name')
        stream_object.game = channel.attrib.get('description')
        stream_object.description = channel.attrib.get('description')
        stream_object.stream_id = stream_id
        stream_object.rtmp_url = stream_url
        
        return stream_object
예제 #6
0
 def get_live_streams(self, game):
     raw_data = self.get_response_data(self.LIST_LIVE_STREAMS_URL)
     xml_doc = utils.build_xml_tree(raw_data)
     items = utils.do_xpath_query(xml_doc, '//item[misc[@game = "%s"]]' % game)
     return self.build_stream_object_list(items)