(urir, index_path)
return cdxj_lines_with_urir
Get all CDXJ records corresponding to a URI-R
Get all CDXJ records corresponding to a URI-R
Get all CDXJ records corresponding to a URI - R
def get_cdxj_lines_with_urir(urir, index_path):
    """ Get all CDXJ records corresponding to a URI-R """
    if not index_path:
        index_path = ipwb_utils.get_ipwb_replay_index_path()

    index_path = get_index_file_full_path(index_path)

    print(f'Getting CDXJ lines with {urir} in {index_path}')
    s = surt.surt(urir, path_strip_trailing_slash_unless_empty=False)
    cdxj_lines_with_urir = []

    cdxj_line_index = get_cdxj_line_binary_search(
        s, index_path, True, True)  # get i

    if cdxj_line_index is None:
        return []

    cdxj_lines = []

    content = get_web_archive_index(index_path)

    cdxj_lines = content.split('\n')
    base_cdxj_line = cdxj_lines[cdxj_line_index]  # via binsearch

    cdxj_lines_with_urir.append(base_cdxj_line)

    # Get lines before pivot that match surt
    sI = cdxj_line_index - 1
    while sI >= 0:
        if cdxj_lines[sI].split(' ')[0] == s:
            cdxj_lines_with_urir.append(cdxj_lines[sI])
        sI -= 1
    # Get lines after pivot that match surt
    sI = cdxj_line_index + 1
    while sI < len(cdxj_lines):
        if cdxj_lines[sI].split(' ')[0] == s:
            cdxj_lines_with_urir.append(cdxj_lines[sI])
        sI += 1
    return cdxj_lines_with_urir
def get_cdxj_lines_with_urir ( urir , index_path ) : if not index_path : index_path = ipwb_utils . get_ipwb_replay_index_path ( ) index_path = get_index_file_full_path ( index_path ) print ( f'Getting CDXJ lines with {urir} in {index_path}' ) s = surt . surt ( urir , path_strip_trailing_slash_unless_empty = False ) cdxj_lines_with_urir = [ ] cdxj_line_index = get_cdxj_line_binary_search ( s , index_path , True , True ) # get i if cdxj_line_index is None : return [ ] cdxj_lines = [ ] content = get_web_archive_index ( index_path ) cdxj_lines = content . split ( '\n' ) base_cdxj_line = cdxj_lines [ cdxj_line_index ] # via binsearch cdxj_lines_with_urir . append ( base_cdxj_line ) # Get lines before pivot that match surt sI = cdxj_line_index - 1 while sI >= 0 : if cdxj_lines [ sI ] . split ( ' ' ) [ 0 ] == s : cdxj_lines_with_urir . append ( cdxj_lines [ sI ] ) sI -= 1 # Get lines after pivot that match surt sI = cdxj_line_index + 1 while sI < len ( cdxj_lines ) : if cdxj_lines [ sI ] . split ( ' ' ) [ 0 ] == s : cdxj_lines_with_urir . append ( cdxj_lines [ sI ] ) sI += 1 return cdxj_lines_with_urir