LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-27-2017, 01:28 AM   #4966
icelancer
LQ Newbie
 
Registered: May 2013
Posts: 26

Rep: Reputation: Disabled

Attempting to build the newest mlbhls (https://github.com/mattiasa/mlbtv-hl...507e9b71f24f5d) leads to this error. Any ideas?

gcc -O2 mlb.c utils.c output.c -lm -lcurl -lcrypto -lconfig -o mlbhls
mlb.c: In function ‘mlb_refresh_playlists’:
mlb.c:169:22: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
sprintf(tmp_url, "%s%s\0", master->base_url, master->streams[i].base_url);
^
mlb.c: In function ‘mlb_process_streams’:
mlb.c:791:10: warning: implicit declaration of function ‘strptime’ [-Wimplicit-function-declaration]
if (strptime(tmp, MLB_HLS_TIME_FORMAT, &tm) != 0)
^
mlb.c: In function ‘mlb_hls_get_and_decrypt’:
mlb.c:859:24: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
sprintf(content_url, "%s%s%s\0", master->base_url, stream->base_url_media, url);
^
mlb.c: In function ‘main’:
mlb.c:1362:43: warning: embedded ‘\0’ in format [-Wformat-contains-nul]
sprintf(master->cmd_params, "%s -cache %d %s\0", master->args->launch_cmd, 4*(master->decrypted_size/(p.stream->seg_time * master->decrypte
^
/usr/bin/ld: /tmp/ccl4PJXi.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:10: recipe for target 'mlb' failed
make: *** [mlb] Error 1
 
Old 05-27-2017, 01:32 AM   #4967
icelancer
LQ Newbie
 
Registered: May 2013
Posts: 26

Rep: Reputation: Disabled
Adding -pthread to the MAKEFILE fixed this for the record.
 
Old 05-27-2017, 02:26 AM   #4968
icelancer
LQ Newbie
 
Registered: May 2013
Posts: 26

Rep: Reputation: Disabled
Checked out the experimental branch, which led to some newer errors.

I dumped the command mlbplayer.py runs and got something like this:

mlbhls -B aHR0cDovL21sYmxpdmUtYWtjLm1sYi5jb20vbHMwMS9tbGJhbS8yMDE3LzA1LzI2L01MQl9HQU1FX1ZJREVPX0tDQUNMRV9IT01F XzIwMTcwNTI2XzE0OTQ5NjUyOTk1NTAvbWFzdGVyX3dpcmVkNjAubTN1OHxvZVNqNmpQTHRSS3BSSTRZTnRTaGVVa2daems9fHBs YXliYWNrPUhUVFBfQ0xPVURfV0lSRURfV0VCJmNvbnRlbnRJZD0xMzkzNzAwODgzJmFwcEFjY291bnROYW1lPW1sYiZldmVudElk PTE0LTQ5MDgyMC0yMDE3LTA1LTI2JmlwaWQ9Nzg1NTcwNjcmc2Vzc2lvbktleT1ybkwlMkJBTExONzZlTnhnSjdhOWdMb2dWU3Ft QSUzRA== -L -s 4500000 -F 22:59:55 -o - | mplayer -cache 4096 -really-quiet

However, mplayer just says there is no stream. Running the first part before the pipe gives:

[MLB] Reading cfg file: mlb.cfg
[MLB] Output file: -
[MLB] Segment Avg. Count: 3
[MLB] Max Bandwidth: 0 (bps)
[MLB] Min Bandwidth: 0 (bps)
[MLB] Bandwidth Locking: 1
[MLB] Fetching Master URL: http://mlblive-akc.mlb.com/ls01/mlba...r_wired60.m3u8
[MLB] Current Priority: 1 (bw: 800000)
[MLB] [DEBUG]- bw: 1800000, prio: 3
[MLB] [DEBUG]- bw: 800000, prio: 5
[MLB] [DEBUG]- bw: 1200000, prio: 4
[MLB] [DEBUG]- bw: 2500000, prio: 2
[MLB] [DEBUG]- bw: 3500000, prio: 1
[MLB] [DEBUG]- bw: 5000000, prio: 0

[MLB] Master URL: http://mlblive-akc.mlb.com/ls01/mlba...r_wired60.m3u8
[MLB] Base URL: http://mlblive-akc.mlb.com/ls01/mlba...1494965299550/
[MLB] Decryption Key: a1e4a3ea33cbb512a9448e1836d4a179
[MLB] Params: playback=HTTP_CLOUD_WIRED_WEB&contentId=1393700883&appAccountName=mlb&eventId=14-490820-2017-05-26&ipid=78557067&sessionKey=rnL%2BALLN76eNxgJ7a9gLogVSqmA%3D
[MLB] Stream #0 - rate: 1800000 - path: [1800K/] - playlist: 1800K/1800_complete-trimmed.m3u8
[MLB] Stream #1 - rate: 800000 - path: [800K/] - playlist: 800K/800_complete-trimmed.m3u8
[MLB] Stream #2 - rate: 1200000 - path: [1200K/] - playlist: 1200K/1200_complete-trimmed.m3u8
[MLB] Stream #3 - rate: 2500000 - path: [2500K/] - playlist: 2500K/2500_complete-trimmed.m3u8
[MLB] Stream #4 - rate: 3500000 - path: [3500K/] - playlist: 3500K/3500_complete-trimmed.m3u8
[MLB] Stream #5 - rate: 5000000 - path: [5000K/] - playlist: 5000K/5000_complete-trimmed.m3u8

[MLB] Playlist refresh time: 12 (s)
[MLB] [DEBUG] Refreshing playlist URLS
[MLB] Refreshing stream End.
[MLB] Refreshing stream End.
[MLB] Refreshing stream End.
[MLB] Refreshing stream End.
[MLB] Refreshing stream End.
[MLB] Refreshing stream End.
[MLB] Playlist start: 82792 (specified start: 82795)

Then starts dumping trash to the terminal (the stream?).

Running it with sudo privs does work, though, and will dump a file.... but this file is unplayable despite being 1.5+ GB in size. Last few error messages are:

[MLB] Get (4870): 02/14/34.ts (bw: 800000, time: 0.21s) [Avg. D/L Rate of last 3 chunks: 27.29 Mbps]
[MLB] Get (4872): 02/14/39.ts (bw: 800000, time: 0.21s) [Avg. D/L Rate of last 3 chunks: 26.16 Mbps]
[MLB] Get (4874): 02/14/44.ts (bw: 800000, time: 0.19s) [Avg. D/L Rate of last 3 chunks: 29.09 Mbps]
[MLB] Get (4876): 02/14/49.ts (bw: 800000, time: 0.20s) [Avg. D/L Rate of last 3 chunks: 26.30 Mbps]
[MLB] Skipping Playlist: 1800K/1800_complete-trimmed.m3u8 (reason: End of Playlist)
[MLB] Skipping Playlist: 800K/800_complete-trimmed.m3u8 (reason: End of Playlist)
[MLB] Skipping Playlist: 1200K/1200_complete-trimmed.m3u8 (reason: End of Playlist)
[MLB] Skipping Playlist: 2500K/2500_complete-trimmed.m3u8 (reason: End of Playlist)
[MLB] Skipping Playlist: 3500K/3500_complete-trimmed.m3u8 (reason: End of Playlist)
[MLB] Skipping Playlist: 5000K/5000_complete-trimmed.m3u8 (reason: End of Playlist)
[MLB] Stream thread exiting

Continuing to look into it...
 
Old 05-27-2017, 02:29 AM   #4969
icelancer
LQ Newbie
 
Registered: May 2013
Posts: 26

Rep: Reputation: Disabled
Calling mlbhls without the -F flag will result in a file that is playable but is just the end of the stream. Obviously there is a stream time finding issue...
 
Old 05-27-2017, 02:40 AM   #4970
icelancer
LQ Newbie
 
Registered: May 2013
Posts: 26

Rep: Reputation: Disabled
Snippets of the Kodi plugin that might help replace mlbhls:
Code:
def createFullGameStream(stream_url, media_auth, media_state):
    #SD (800 kbps)|SD (1600 kbps)|HD (3000 kbps)|HD (5000 kbps)        
    bandwidth = ''
    bandwidth = find(QUALITY,'(',' kbps)')

    if QUALITY == 'Always Ask':
        bandwidth = getStreamQuality(stream_url)

    #Only set bandwidth if it's explicitly set
    if bandwidth != '':
        if media_state == 'MEDIA_ARCHIVE':                
            #ARCHIVE
            #stream_url = stream_url.replace(MASTER_FILE_TYPE, bandwidth+'K/'+bandwidth+'_complete_fwv2-trimmed.m3u8') 
            stream_url = stream_url.replace(MASTER_FILE_TYPE, bandwidth+'K/'+bandwidth+'_complete-trimmed.m3u8')
        elif media_state == 'MEDIA_ON':
            #LIVE   
            #stream_url = stream_url.replace(MASTER_FILE_TYPE, bandwidth+'K/'+bandwidth+'_slide_fwv2.m3u8') 
            stream_url = stream_url.replace(MASTER_FILE_TYPE, bandwidth+'K/'+bandwidth+'_complete.m3u8')

    #CDN
    akc_url = 'akc.mlb.com'
    l3c_url = 'l3c.mlb.com'
    if CDN == 'Akamai' and  akc_url not in stream_url:
        stream_url = stream_url.replace(l3c_url,akc_url)
    elif CDN == 'Level 3' and  l3c_url not in stream_url:
        stream_url = stream_url.replace(akc_url,l3c_url)
    
    #stream_url = stream_url + '|User-Agent='+UA_IPAD+'&Cookie='+media_auth
    stream_url = stream_url + '|User-Agent='+UA_PS4+'&Cookie='+media_auth
    
    return stream_url
and

Code:
def fetchStream(content_id,event_id,playback_scenario):        
    stream_url = ''
    media_auth = ''       
    identity_point_id = ''
    fingerprint = '' 

    expired_cookies = True
    try:
        cj = cookielib.LWPCookieJar(os.path.join(ADDON_PATH_PROFILE, 'cookies.lwp')) 
        cj.load(os.path.join(ADDON_PATH_PROFILE, 'cookies.lwp'),ignore_discard=True)        

        #Check if cookies have expired
        at_least_one_expired = False
        num_cookies = 0
        for cookie in cj:                        
            num_cookies += 1            
            if cookie.is_expired():
                at_least_one_expired = True
                break

        if not at_least_one_expired:
            expired_cookies = False
    except:
        pass

    if expired_cookies or num_cookies == 0 or USERNAME != OLD_USERNAME or PASSWORD != OLD_PASSWORD:
        #Remove cookie file
        cookie_file = xbmc.translatePath(os.path.join(ADDON_PATH_PROFILE+'cookies.lwp'))
        try:
            os.remove(cookie_file)
        except:
            pass
        login()


    cj = cookielib.LWPCookieJar(os.path.join(ADDON_PATH_PROFILE, 'cookies.lwp'))     
    cj.load(os.path.join(ADDON_PATH_PROFILE, 'cookies.lwp'),ignore_discard=True)
    for cookie in cj:         
        if cookie.name == "ipid":
            identity_point_id = cookie.value
        elif cookie.name == "fprt":
            fingerprint = cookie.value

    if identity_point_id == '' or fingerprint == '':
        return stream_url, media_auth


    session_key = getSessionKey(content_id,event_id,identity_point_id,fingerprint)
    #Reload Cookies
    cj = cookielib.LWPCookieJar(os.path.join(ADDON_PATH_PROFILE, 'cookies.lwp'))     
    cj.load(os.path.join(ADDON_PATH_PROFILE, 'cookies.lwp'),ignore_discard=True)

    if PROXY_ENABLED != 'true':
        opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))        
    else:
        proxy_url = 'http://'+PROXY_SERVER+':'+PROXY_PORT
        proxy_support = urllib2.ProxyHandler({ 'http': proxy_url, 'https': proxy_url })
        if PROXY_USER != '' and PROXY_PWD != '':
            auth_handler = urllib2.ProxyBasicAuthHandler()
            auth_handler.add_password(None, proxy_url, PROXY_USER, PROXY_PWD)
            opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj), proxy_support, auth_handler)
        else:
            opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj), proxy_support)

        urllib2.install_opener(opener)

    if session_key == '':
        return stream_url, media_auth
    elif session_key == 'blackout':
        msg = "The game you are trying to access is not currently available due to local or national blackout restrictions.\n Full game archives will be available 48 hours after completion of this game."
        dialog = xbmcgui.Dialog() 
        ok = dialog.ok('Game Blacked Out', msg) 
        return stream_url, media_auth

      
    url = 'https://mlb-ws-mf.media.mlb.com/pubajaxws/bamrest/MediaService2_0/op-findUserVerifiedEvent/v-2.3'   
    url = url + '?identityPointId='+identity_point_id
    url = url + '&fingerprint='+fingerprint
    url = url + '&contentId='+content_id    
    url = url + '&eventId='+event_id
    url = url + '&playbackScenario='+playback_scenario        
    url = url + '&subject=LIVE_EVENT_COVERAGE'
    url = url + '&sessionKey='+urllib.quote_plus(session_key)
    url = url + '&platform=PS4'
    url = url + '&format=json'    
    req = urllib2.Request(url)       
    req.add_header("Accept", "*/*")
    req.add_header("Accept-Encoding", "deflate")
    req.add_header("Accept-Language", "en-US,en;q=0.8")                       
    req.add_header("Connection", "keep-alive")    
    req.add_header("User-Agent", UA_PS4)

    response = opener.open(req)    
    json_source = json.load(response)                                   
    response.close()
    
    

    if json_source['status_code'] == 1:
        uv_media_item = json_source['user_verified_event'][0]['user_verified_content'][0]['user_verified_media_item'][0]        
        if 'BLACKOUT' in str(uv_media_item ['blackout_status']).upper():            
            msg = "We're sorry.  We have determined that you are blacked out of watching the game you selected due to Major League Baseball exclusivities."
            #try:
            if str(uv_media_item ['media_item']['state']).upper() == 'MEDIA_ARCHIVE':
                #cc_url = str(json_source['user_verified_event'][0]['user_verified_content'][0]['domain_specific_attributes'][3]['value'])
                for attribute in json_source['user_verified_event'][0]['user_verified_content'][0]['domain_specific_attributes']:
                    if str(attribute['name']).lower() == 'inning_index_location_xml':
                        inning_xml_url = str(attribute['value'])
                        #inning_xml_url = "http://mlb.mlb.com/mlb/mmls2016/447002.xml"
                        blackout_lift_min, blackout_lift_time = getBlackoutLiftTime(inning_xml_url)
                        msg = msg + " This blackout will expire in "+str(blackout_lift_min)+" minutes at approximately "+str(blackout_lift_time)+"."
                        break

            dialog = xbmcgui.Dialog() 
            ok = dialog.ok('Game Blacked Out', msg) 
            sys.exit()
            xbmc.executebuiltin('Dialog.Close(all,true)')
        elif str(uv_media_item ['auth_status']) == 'NotAuthorizedStatus':
            msg = "You do not have an active MLB.TV premium subscription. If you are using a Single Team or Free subscription please check this is enabled in the addon settings."
            dialog = xbmcgui.Dialog() 
            ok = dialog.ok('Account Not Authorized', msg) 
            sys.exit()
            xbmc.executebuiltin('Dialog.Close(all,true)')
        else:
            stream_url = uv_media_item ['url']                
            #Find subtitles
            '''
            for item in json_source['user_verified_event'][0]['user_verified_content'][0]['domain_specific_attributes']:
                if item['name'] == 'closed_captions_location_ttml':
                    subtitles_url = item['value']
                    convertSubtitles(subtitles_url)
            '''
            session_key = json_source['session_key']            
            #Update Session Key
            settings.setSetting(id='session_key', value=session_key)   
    else:
        msg = json_source['status_message']
        dialog = xbmcgui.Dialog() 
        ok = dialog.ok('Error Fetching Stream', msg)     
        
    
    for cookie in cj:         
        if cookie.name == "mediaAuth":
            media_auth = "mediaAuth="+cookie.value
            settings.setSetting(id='media_auth', value=media_auth)
    
    cj.save(ignore_discard=True)

    return stream_url, media_auth
and

Code:
def getSessionKey(content_id,event_id,identity_point_id,fingerprint):    
    #session_key = ''
    session_key = str(settings.getSetting(id="session_key"))

    if session_key == '':               
        cj = cookielib.LWPCookieJar(os.path.join(ADDON_PATH_PROFILE, 'cookies.lwp')) 
        cj.load(os.path.join(ADDON_PATH_PROFILE, 'cookies.lwp'),ignore_discard=True)
        opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))  

        epoch_time_now = str(int(round(time.time()*1000)))           
        url = 'https://mlb-ws-mf.media.mlb.com/pubajaxws/bamrest/MediaService2_0/op-findUserVerifiedEvent/v-2.3'
        url = url + '?identityPointId='+identity_point_id
        url = url + '&fingerprint='+fingerprint
        url = url + '&eventId='+event_id
        url = url + '&subject=LIVE_EVENT_COVERAGE'
        url = url + '&platform=WIN8'
        url = url + '&frameworkURL=https://mlb-ws-mf.media.mlb.com&frameworkEndPoint=/pubajaxws/bamrest/MediaService2_0/op-findUserVerifiedEvent/v-2.3'
        url = url + '&_='+epoch_time_now

        req = urllib2.Request(url)       
        req.add_header("Accept", "*/*")
        req.add_header("Accept-Encoding", "deflate")
        req.add_header("Accept-Language", "en-US,en;q=0.8")                       
        req.add_header("Connection", "keep-alive")        
        req.add_header("User-Agent", UA_PC)
        req.add_header("Origin", "http://m.mlb.com")        
        req.add_header("Referer", "http://m.mlb.com/tv/e"+event_id+"/v"+content_id+"/?&media_type=video&clickOrigin=Media Grid&team=mlb&forwardUrl=http://m.mlb.com/tv/e"+event_id+"/v"+content_id+"/?&media_type=video&clickOrigin=Media%20Grid&team=mlb&template=mp5default&flowId=registration.dynaindex&mediaTypeTemplate=video")
        
        response = opener.open(req)
        xml_data = response.read()
        response.close()
                
        session_key = find(xml_data,'<session-key>','</session-key>')
        settings.setSetting(id='session_key', value=session_key)

        '''
        if json_source['status_code'] == 1:      
            if json_source['user_verified_event'][0]['user_verified_content'][0]['user_verified_media_item'][0]['blackout_status']['status'] == 'BlackedOutStatus':
                msg = "You do not have access to view this content. To watch live games and learn more about blackout restrictions, please visit NHL.TV"
                session_key = 'blackout'
            else:    
                session_key = str(json_source['session_key'])
                settings.setSetting(id='session_key', value=session_key)                              
        else:
            msg = json_source['status_message']
            dialog = xbmcgui.Dialog() 
            ok = dialog.ok('Error Fetching Stream', msg)            
        '''
    return session_key
 
Old 05-27-2017, 02:51 AM   #4971
icelancer
LQ Newbie
 
Registered: May 2013
Posts: 26

Rep: Reputation: Disabled
Also can confirm that Kodi's MLB.tv plugin works and is streaming 720p 60f video normally.
 
Old 05-27-2017, 03:18 AM   #4972
icelancer
LQ Newbie
 
Registered: May 2013
Posts: 26

Rep: Reputation: Disabled
Sorry I keep flooding the thread, but want to document as much as possible. It seems like the start time of the game is the issue. mlbhls is working fine in downloading the files, they're just started at the wrong time so the file is corrupt.

Is it this function that is causing the issues and offset problems?

Code:
def getStartOfGame(self,listing,cfg):
        start_time = 0
        try:
            innings = self.parseInningsXml(listing[2][0][3],
                                              cfg.get('use_nexdef'))
        except:
            return None
        if listing[5] in ('I', 'D', 'NB' ) and start_time == 0:
            if cfg.get('live_from_start') and cfg.get('use_nexdef'):
                if innings is not None:
                    start_time = innings[0]
        else:
            if cfg.get('use_nexdef'):
                if innings is not None:
                    start_time = innings[0]
                    # hack to make sure mlbhls can start at the correct
                    # timestamp - add five seconds to published time
                    #d=datetime.datetime.strptime(start_time, "%H:%M:%S")
                    #t=datetime.timedelta(seconds=5)
                    #n=d+t
                    #start_time=n.strftime("%H:%M:%S")
                else:
                    start_time=listing[8]

        return start_time
 
Old 05-27-2017, 03:54 AM   #4973
icelancer
LQ Newbie
 
Registered: May 2013
Posts: 26

Rep: Reputation: Disabled
I uncommented the offset code and ran it, but that didn't help. For this KCA/CLE game on 5/26 the mlbhls output gives me a playable file that has the "Thanks for watching the game" banner flying if I use anything before -F 22:59:00. When I use 23:00:00 or above, it dumps an unintelligible file that mplayer cannot read.

The tfs_zulu for this file is 23:11:27 (cannot tell from daftcat's code how exactly this time is pulled since mlbplayer will spit out 22:59:55 without the offset code and 23:00:00 with it).

Find that here: http://gd2.mlb.com/components/game/m...g/inning_1.xml

With more testing, this command will generate a playable "end of game" file:

Code:
mlbhls -B [my base64 code] -L -s 5000000 -F 22:59:51 -o test3.mp4
But this one will produce nonsense:

Code:
mlbhls -B [my base64 code] -L -s 5000000 -F 22:59:52 -o test3.mp4
Well.... not sure what the deal is there.
 
Old 05-27-2017, 04:07 AM   #4974
icelancer
LQ Newbie
 
Registered: May 2013
Posts: 26

Rep: Reputation: Disabled
Ah ha! So finally I see the TS files "directories" really just correspond to time codes. And for some reason mlbhls is screwing up the offset. When it says Get (8), Get (10) there's clearly stuff behind it that's not being captured.

See how I tried a time stamp in the past for this stream and it worked:

Code:
[MLB] Reading cfg file: mlb.cfg
[MLB] Output file: test3.mp4
[MLB] Segment Avg. Count: 3
[MLB] Max Bandwidth: 0 (bps)
[MLB] Min Bandwidth: 0 (bps)
[MLB] Bandwidth Locking: 1
[MLB] Fetching Master URL: http://mlblive-akc.mlb.com/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/master_wired60.m3u8
[MLB] Current Priority: 5 (bw: 5000000)

[MLB] Master URL: http://mlblive-akc.mlb.com/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/master_wired60.m3u8
[MLB] Base URL: http://mlblive-akc.mlb.com/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/
[MLB] Decryption Key: a1e4a3ea33cbb512a9448e1836d4a179
[MLB] Params: playback=HTTP_CLOUD_WIRED_WEB&contentId=1393700883&appAccountName=mlb&eventId=14-490820-2017-05-26&ipid=78557067&sessionKey=rnL%2BALLN76eNxgJ7a9gLogVSqmA%3D
[MLB] Stream #0 - rate:  1800000 - path: [1800K/] - playlist: 1800K/1800_complete-trimmed.m3u8
[MLB] Stream #1 - rate:   800000 - path: [800K/] - playlist: 800K/800_complete-trimmed.m3u8
[MLB] Stream #2 - rate:  1200000 - path: [1200K/] - playlist: 1200K/1200_complete-trimmed.m3u8
[MLB] Stream #3 - rate:  2500000 - path: [2500K/] - playlist: 2500K/2500_complete-trimmed.m3u8
[MLB] Stream #4 - rate:  3500000 - path: [3500K/] - playlist: 3500K/3500_complete-trimmed.m3u8
[MLB] Stream #5 - rate:  5000000 - path: [5000K/] - playlist: 5000K/5000_complete-trimmed.m3u8

[MLB] Playlist refresh time: 12 (s)
[MLB] Playlist start: 82792 (specified start: 82793)
[MLB] END OF PLAYLIST! (rate: 1800000)
[MLB] Setting stream start time to (epoch): 1495864792
[MLB] ##### start_from_playlist: 1 -- 1 -- 4877
[MLB] END OF PLAYLIST! (rate: 800000)
[MLB] END OF PLAYLIST! (rate: 1200000)
[MLB] END OF PLAYLIST! (rate: 2500000)
[MLB] END OF PLAYLIST! (rate: 3500000)
[MLB] END OF PLAYLIST! (rate: 5000000)
[MLB] Get (8): 22/59/52.ts (bw: 5000000, time: 0.83s) [Avg. D/L Rate of last 3 chunks: 32.39 Mbps]
[MLB] Get (10): 22/59/57.ts (bw: 5000000, time: 0.96s) [Avg. D/L Rate of last 3 chunks: 27.61 Mbps]
[MLB] Get (12): 23/00/02.ts (bw: 5000000, time: 0.74s) [Avg. D/L Rate of last 3 chunks: 41.71 Mbps]
[MLB] Get (14): 23/00/07.ts (bw: 5000000, time: 0.58s) [Avg. D/L Rate of last 3 chunks: 47.15 Mbps]
[MLB] Get (16): 23/00/12.ts (bw: 5000000, time: 0.48s) [Avg. D/L Rate of last 3 chunks: 47.61 Mbps]
[MLB] Get (18): 23/00/17.ts (bw: 5000000, time: 0.65s) [Avg. D/L Rate of last 3 chunks: 47.40 Mbps]
^C
mlbviewer@mlbviewer:~/mlbtv-hls-nexdef$ sudo wget http://mlblive-akc.mlb.com/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/5000K/22/59/47.ts
--2017-05-27 02:06:13--  http://mlblive-akc.mlb.com/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/5000K/22/59/47.ts
Resolving mlblive-akc.mlb.com (mlblive-akc.mlb.com)... 23.204.103.105, 23.204.103.137, 2001:559:19:1800::1720:2e32, ...
Connecting to mlblive-akc.mlb.com (mlblive-akc.mlb.com)|23.204.103.105|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3473120 (3.3M) [video/mpeg]
Saving to: ‘47.ts’

47.ts                                        100%[============================================================================================>]   3.31M  3.86MB/s    in 0.9s    

2017-05-27 02:06:14 (3.86 MB/s) - ‘47.ts’ saved [3473120/3473120]
More to investigate!
 
Old 05-27-2017, 04:17 AM   #4975
icelancer
LQ Newbie
 
Registered: May 2013
Posts: 26

Rep: Reputation: Disabled
So I used httpry to look into the URLs being requested, and my above guess I don't think is right. Here's the dump from a working Kodi MLB.tv stream:

Code:
2017-05-27 02:16:15	23.32.46.40	10.0.2.15	<	-	-	-	HTTP/1.1	200	OK
2017-05-27 02:16:19	10.0.2.15	23.204.103.105	>	HEAD	mlblive-akc.mlb.com	/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/5000K/5000_complete-trimmed.m3u8	HTTP/1.1	-	-
2017-05-27 02:16:19	23.204.103.105	10.0.2.15	<	-	-	-	HTTP/1.1	200	OK
2017-05-27 02:16:19	10.0.2.15	23.204.103.105	>	HEAD	mlblive-akc.mlb.com	/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/5000K/5000_complete-trimmed.m3u8	HTTP/1.1	-	-
2017-05-27 02:16:19	23.204.103.105	10.0.2.15	<	-	-	-	HTTP/1.1	200	OK
2017-05-27 02:16:19	10.0.2.15	23.204.103.137	>	GET	mlblive-akc.mlb.com	/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/5000K/5000_complete-trimmed.m3u8	HTTP/1.1	-	-
2017-05-27 02:16:20	23.204.103.137	10.0.2.15	<	-	-	-	HTTP/1.1	206	Partial Content
2017-05-27 02:16:20	10.0.2.15	23.204.103.105	>	GET	mlblive-akc.mlb.com	/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/5000K/5000_complete-trimmed.m3u8	HTTP/1.1	-	-
2017-05-27 02:16:20	23.204.103.105	10.0.2.15	<	-	-	-	HTTP/1.1	206	Partial Content
2017-05-27 02:16:20	10.0.2.15	23.204.103.137	>	GET	mlblive-akc.mlb.com	/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/5000K/22/59/52.ts	HTTP/1.1	--
2017-05-27 02:16:20	23.204.103.137	10.0.2.15	<	-	-	-	HTTP/1.1	200	OK
2017-05-27 02:16:21	10.0.2.15	23.204.103.105	>	GET	mlblive-akc.mlb.com	/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/5000K/22/59/52.ts	HTTP/1.1	--
2017-05-27 02:16:21	23.204.103.105	10.0.2.15	<	-	-	-	HTTP/1.1	200	OK
2017-05-27 02:16:22	10.0.2.15	23.204.103.137	>	GET	mlblive-akc.mlb.com	/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/5000K/22/59/57.ts	HTTP/1.1	--
2017-05-27 02:16:22	23.204.103.137	10.0.2.15	<	-	-	-	HTTP/1.1	200	OK
2017-05-27 02:16:23	10.0.2.15	23.204.103.105	>	GET	mlblive-akc.mlb.com	/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/5000K/23/00/02.ts	HTTP/1.1	--
2017-05-27 02:16:23	23.204.103.105	10.0.2.15	<	-	-	-	HTTP/1.1	200	OK
2017-05-27 02:16:25	10.0.2.15	23.204.103.137	>	GET	mlblive-akc.mlb.com	/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/5000K/23/00/07.ts	HTTP/1.1	--
2017-05-27 02:16:25	23.204.103.137	10.0.2.15	<	-	-	-	HTTP/1.1	200	OK
2017-05-27 02:16:33	10.0.2.15	23.204.103.105	>	GET	mlblive-akc.mlb.com	/ls01/mlbam/2017/05/26/MLB_GAME_VIDEO_KCACLE_HOME_20170526_1494965299550/5000K/23/00/12.ts	HTTP/1.1	--
2017-05-27 02:16:33	23.204.103.105	10.0.2.15	<	-	-	-	HTTP/1.1	200	OK
Clearly the first transport stream (TS) file is 22/59/52.ts, so the files before it can't matter.

This leads me to believe that mlbhls is not assembling the TS files correctly.
 
Old 05-27-2017, 04:44 AM   #4976
icelancer
LQ Newbie
 
Registered: May 2013
Posts: 26

Rep: Reputation: Disabled
Fortunately for me (and everyone here), Mattias was kind enough to respond to my emails and say to try his branch, which works great!

https://github.com/mattiasa/mlbtv-hl.../tree/mattiasa

He said:

Quote:
I simply patched it to always download from the start of the stream if no -F flag is supplied.
So maybe patch mlbviewer to have no -F flag? Not sure. Anyway, it definitely works with no -F flag, I've just tested and confirmed it.
 
Old 05-30-2017, 06:13 PM   #4977
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
The -F option is needed to find the correct start of game and start of innings.

The experimental branch of mlbhls is needed for the -F argument.

I'm sure you can find your way to hack that option out of my code. But I'm also certain your experience with mlbviewer will be better if you keep it. Search this thread for "F patch" or "mlbhls experimental branch" if you still need assistance finding the correct version of mlbhls.
 
Old 06-04-2017, 07:33 PM   #4978
miniMarine
LQ Newbie
 
Registered: Jun 2017
Posts: 1

Rep: Reputation: Disabled
can't get the viewer to run

Hi all, I've recently installed the latest version of the MLB viewer. I've gone through the requirements page and I've installed all of the dependiencies. When I try to run the script I get:

python2 mlbviewer.py
Traceback (most recent call last):
File "mlbviewer.py", line 1395, in <module>
curses.wrapper(mainloop, mycfg, mykeys)
File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "mlbviewer.py", line 87, in mainloop
log = open(LOGFILE, "a")
IOError: [Errno 13] Permission denied: '/home/tony/.mlb/log'

I'm not really sure what's going on here. thanks for the help.
 
Old 06-05-2017, 08:31 PM   #4979
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Quote:
Originally Posted by miniMarine View Post
Hi all, I've recently installed the latest version of the MLB viewer. I've gone through the requirements page and I've installed all of the dependiencies. When I try to run the script I get:

python2 mlbviewer.py
Traceback (most recent call last):
File "mlbviewer.py", line 1395, in <module>
curses.wrapper(mainloop, mycfg, mykeys)
File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "mlbviewer.py", line 87, in mainloop
log = open(LOGFILE, "a")
IOError: [Errno 13] Permission denied: '/home/tony/.mlb/log'

I'm not really sure what's going on here. thanks for the help.
Looks like a permission issue like maybe you ran it once as root or sudo and now the log (or directory) is not writable by your user account.

What does "ls -ld /home/tony/.mlb" say? And "ls -l /home/tony/.mlb/log"? Please copy the outputs in a reply before fixing this so I can understand how you got here in the first place.

This should fix it, though.

Code:
sudo chown -R tony /home/tony/.mlb
 
Old 10-27-2017, 10:06 PM   #4980
pajamian
Member
 
Registered: Oct 2009
Posts: 38

Rep: Reputation: 1
ERROR: You are not authorized to view this content.

When attempting to watch the World Series game 3:

Code:
ERROR: You are not authorized to view this content.
If you are a basic subscriber, try the home stream.

See /home/peter/.mlb/log for more details.
.mlb/log:
Code:
10/28 16:01 | SUCCESSFUL MEDIA REQUEST: status-code: 1 , event-id = 14-526513-2017-10-27

10/28 16:01 | See /home/peter/.mlb/successful-1.xml for XML response.

10/28 16:01 | Received a notAuthorized status.  Response was saved in /home/peter/.mlb/unsuccessful-2.xml.
unsuccessful-2.xml:
Code:
<?xml version="1.0" ?><user-verified-media-response xmlns="http://services.bamnetworks.com/media/types/2.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><user-verified-event><event-id>14-526513-2017-10-27</event-id><user-verified-content><content-id>1865081783</content-id><type>video</type><user-verified-media-item><media-item><type>video</type><state>MEDIA_ON</state><cat-code>mlb_media_mlb_lg</cat-code><login-required>true</login-required><auth-required>true</auth-required><blackout-keywords><blackout-keyword>MLB_NON_US_BLACKOUT</blackout-keyword></blackout-keywords><playback-scenario>FMS_CLOUD</playback-scenario><has-synched-data>false</has-synched-data><preview-url><![CDATA[http://mediadownloads.mlb.com/mlbam/preview/lanhou_1200_preview.mp4]]></preview-url><innings-index>http://mlb.mlb.com/mlb/mmls2017/526513.xml</innings-index><cdns><cdn-name>PRIMARY_AKAMAI</cdn-name></cdns><sequence>1</sequence><duration xsi:nil="true"/></media-item><url/><auth-status><notAuthorizedStatus/></auth-status><blackout-status><blackedOutStatus><blackout>MLB_NON_US_BLACKOUT</blackout></blackedOutStatus></blackout-status></user-verified-media-item><domain-specific-attributes><domain-attribute name="content_guid">497eb118-e5c0-457a-a593-2d184a4b0170</domain-attribute><domain-attribute name="game_pk">526513</domain-attribute><domain-attribute name="milestones_xml">http://mlb.mlb.com/mlb/mmls2017/14-526513-2017-10-27.xml</domain-attribute><domain-attribute name="authflow">true</domain-attribute><domain-attribute name="calendar_event_id">14-526513-2017-10-27</domain-attribute><domain-attribute name="coverage_type">out-of-market</domain-attribute><domain-attribute name="inning_index_location_xml">http://mlb.mlb.com/mlb/mmls2017/526513.xml</domain-attribute><domain-attribute name="event_date">2017-10-27T20:00:00-0400</domain-attribute><domain-attribute name="source_aspect_ratio">HD</domain-attribute><domain-attribute name="closed_captions_location_ttml">http://mediadownloads.mlb.com/ttml/2017/10/28/1865081783.ttml</domain-attribute><domain-attribute name="coverage_association">0</domain-attribute><domain-attribute name="combined_media_state">MEDIA_ON</domain-attribute><domain-attribute name="default_dam_view_key">MLBTV_MP_4</domain-attribute><domain-attribute name="game_events_location_plist">http://gdx.mlb.com/components/game/mlb/year_2017/month_10/day_27/gid_2017_10_27_lanmlb_houmlb_1/game_events.plist</domain-attribute><domain-attribute name="in_epg">mlb_mp4_epg</domain-attribute><domain-attribute name="subject">LIVE_EVENT_COVERAGE</domain-attribute><domain-attribute name="subject">MLBTV</domain-attribute><domain-attribute name="mmtax">fox-auth-required</domain-attribute><domain-attribute name="milestones_plist">http://mlb.mlb.com/mlb/mmls2017/14-526513-2017-10-27.plist</domain-attribute><domain-attribute name="away_team_id">119</domain-attribute><domain-attribute name="home_team_id">117</domain-attribute><domain-attribute name="game_id">2017/10/27/lanmlb-houmlb-1</domain-attribute><domain-attribute name="run_scoring_plays_location_plist">http://gdx.mlb.com/components/game/mlb/year_2017/month_10/day_27/gid_2017_10_27_lanmlb_houmlb_1/runScoringPlays.plist</domain-attribute><domain-attribute name="call_letters">FOX-NAT</domain-attribute><domain-attribute name="inning_index_location_plist">http://mlb.mlb.com/mlb/mmls2017/526513.plist</domain-attribute></domain-specific-attributes><view-keys><view-key><key>MLBTV_MP_4</key></view-key></view-keys><features/><tracking><conviva><tracking-attributes><conviva-attribute name="c3.viewer.id" value="18593294"/><conviva-attribute name="med" value="video"/><conviva-attribute name="assetName" value="DAM Media: 1865081783 2017-10-28 : lan at hou | MLBTV"/><conviva-attribute name="fguid" value="0ef147cd03d34c4fbc146403c33f1dee"/><conviva-attribute name="mlb.vtm" value="119"/><conviva-attribute name="prt" value="mlb"/><conviva-attribute name="mlb.ltr" value="FOX-NAT"/><conviva-attribute name="state" value="MEDIA_ON"/><conviva-attribute name="conid" value="1865081783"/><conviva-attribute name="mlb.htm" value="117"/><conviva-attribute name="pbs" value="FMS_CLOUD"/><conviva-attribute name="mlb.gpk" value="526513"/><conviva-attribute name="calid" value="14-526513-2017-10-27"/></tracking-attributes></conviva><auditude><tracking-attributes><auditude-attribute name="kv" value=""/></tracking-attributes></auditude></tracking></user-verified-content><domain-specific-attributes/></user-verified-event><determined-location><postal-code>0644</postal-code><country-code>nz</country-code></determined-location><session-key>6LE7gmrs6aU7MXnndbxLRMM/J4A=</session-key><session-info/><status-code>1</status-code><status-message>Success Status</status-message></user-verified-media-response>
I have both international=True and postseason=True in my config file.

Peter
 
  


Reply

Tags
help, install, installation, instructions, seek, vlc, windows



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mlb.com gameday audio stream statmobile Linux - Newbie 6 05-06-2008 10:16 PM
link dies intermittently-seemingly at random- between win<->linux not linux<->linux?? takahaya Linux - Networking 10 03-09-2007 10:37 PM
triple boot linux/linux/linux No Windows involved toastermaker Linux - Newbie 12 03-02-2006 10:40 PM
Redhat (rhel v2.1) bootup problem with linux (linux vs linux-up) namgor Linux - Software 2 06-24-2004 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration