# Path: module/plugins/internal/misc.py
# def format_exc(frame=None):
#     """
#     Format call-stack and display exception information (if availible)
#     """
#     exc_info = sys.exc_info()
#     exc_desc = u""
# 
#     callstack = traceback.extract_stack(frame)
#     callstack = callstack[:-1]
# 
#     if exc_info[0] is not None:
#         exception_callstack = traceback.extract_tb(exc_info[2])
# 
#         # @NOTE: Does this exception belongs to us?
#         if callstack[-1][0] == exception_callstack[0][0]:
#             callstack = callstack[:-1]
#             callstack.extend(exception_callstack)
#             exc_desc = decode(
#                 "".join(
#                     traceback.format_exception_only(
#                         exc_info[0],
#                         exc_info[1])))
# 
#     msg = u"Traceback (most recent call last):\n"
#     msg += decode("".join(traceback.format_list(callstack)))
#     msg += exc_desc
# 
#     return msg


import re
from module.network.RequestFactory import getURL as get_url
from ..internal.misc import format_exc
from ..internal.SimpleHoster import SimpleHoster
                if 'location' in headers and headers['location']:
                    redirect = headers['location']

                else:
                    if 'content-type' in headers and headers[
                            'content-type'] == "application/octet-stream":
                        if "filename=" in headers.get('content-disposition'):
                            _name = dict(
                                _i.split("=") for _i in map(str.strip, headers[
                                    'content-disposition'].split(";"))[1:])
                            name = _name['filename'].strip("\"'")
                        else:
                            name = url

                        info = {'name': name,
                                'size': long(headers.get('content-length')),
                                'status': 7,
                                'url': url}

                    else:
                        info = SimpleHoster.get_info(url, html)

                    break

            except Exception, e:
                print(format_exc())
                info = {'status': 8,
                        'error': e.message}
                break


# Path: module/plugins/internal/misc.py
# def format_exc(frame=None):
#     """
#     Format call-stack and display exception information (if availible)
#     """
#     exc_info = sys.exc_info()
#     exc_desc = u""
# 
#     callstack = traceback.extract_stack(frame)
#     callstack = callstack[:-1]
# 
#     if exc_info[0] is not None:
#         exception_callstack = traceback.extract_tb(exc_info[2])
# 
#         # @NOTE: Does this exception belongs to us?
#         if callstack[-1][0] == exception_callstack[0][0]:
#             callstack = callstack[:-1]
#             callstack.extend(exception_callstack)
#             exc_desc = decode(
#                 "".join(
#                     traceback.format_exception_only(
#                         exc_info[0],
#                         exc_info[1])))
# 
#     msg = u"Traceback (most recent call last):\n"
#     msg += decode("".join(traceback.format_list(callstack)))
#     msg += exc_desc
# 
#     return msg


# Path: module/plugins/hoster/OneFichierCom.py
import re
from module.network.RequestFactory import getURL as get_url
from ..internal.misc import format_exc
from ..internal.SimpleHoster import SimpleHoster

                if 'location' in headers and headers['location']:
                    redirect = headers['location']

                else:
                    if 'content-type' in headers and headers[
                            'content-type'] == "application/octet-stream":
                        if "filename=" in headers.get('content-disposition'):
                            _name = dict(
                                _i.split("=") for _i in map(str.strip, headers[
                                    'content-disposition'].split(";"))[1:])
                            name = _name['filename'].strip("\"'")
                        else:
                            name = url

                        info = {'name': name,
                                'size': long(headers.get('content-length')),
                                'status': 7,
                                'url': url}

                    else:
                        info = SimpleHoster.get_info(url, html)

                    break

            except Exception, e:
                print(format_exc())
                info = {'status': 8,
                        'error': e.message}
                break


        else: