import re


def get_root_of_unsplitable(path):
    """
    Scans a path for the actual scene release name, e.g. skipping cd1 folders.
    
    Returns None if no scene folder could be found
    """
    path = path[::-1]
    for p in path:
        if not p:
            continue
        
        if re.match(r'^(cd[1-9])|(samples?)|(proofs?)|((vob)?sub(title)?s?)$', p, re.IGNORECASE): # scene paths
            continue
        
        if re.match(r'^(bdmv)|(disc\d*)|(video_ts)$', p, re.IGNORECASE): # bluray / dd
            continue
        
        
        return p