
    ݦi                     8    d dl Z d dlZd dlmZ ddlmZ d Zd Zy)    N)urlsplit   )BASE_DIRc                      	 t        j                         } t        j                  j	                  t        j                  j                  t        d            }| j                  |       | S # t        $ r} d }~ww xY w)Nz
config.ini)	configparserConfigParserospathnormpathjoinr   read	Exception)configconfig_file_pathes      //home/hirelines/hirelines/hirelines/metadata.py	getConfigr      s^    **,77++BGGLL,,OP$% s   A'A* *	A93A44A9c                    	 d| j                   vry| j                   d   }t        |      j                  }t               d   d   }|j	                  d      }||vryy# t
        $ r}t        dt        |             Y d }~yd }~ww xY w)NHTTP_ORIGINFREFERRERallowed_domains,TzError checking referrer: )METAr   hostnamer   splitr   printstr)requestreferrerreferrer_hostmedia_responseallowed_referrersr   s         r   check_referrerr#      s    ,<<. *33"Z01BC*005 11 )3q62s   A A	A 	B%A??B)r	   r   urllib.parser   settingsr   r   r#        r   <module>r(      s    	  ! 	r'   