https://github.com/roaet/wafflehaus/blob/master/wafflehaus/requestnetworks.py#L80

That will be better for splitting it up, then path[-1].split('.')[0] will five the id.