# -*- coding:UTF-8 -*-
# @Time  : 2020/7/24 17:59
# @File  : func_calculate_douban_id.py
# @email : litao@igengmei.com
# @author : litao
import re


def calculate_douban_id(data_dic):
    if data_dic.get("mid"):
        return data_dic.get("mid")
    else:
        try:
            find_mid = re.findall('(\d+)', data_dic["url"])[0]
            return find_mid
        except:
            return data_dic["url"]