<commit_before>import os
import re
import sys, getopt

class YtbMP3Server:
    """docstring for YtbMP3Server"""
    def __init__(self):
        self.addresses = ''
        self.proxy = ''
        self.b = '320'

    def download(self, opts, args):
        for address in args:
            self.addresses += (' ' + address)

        for op, v in opts:
            if op == '-p':
                self.proxy = v
            elif op == '-b':
                slef.b = v

        print self.proxy
        if self.proxy == '':
            dl = os.popen('youtube-dl' + self.addresses).read()
        else:
            dl = os.popen('youtube-dl --proxy ' + self.proxy + self.addresses).read()
            # print os.path.dirname(os.path.realpath(__file__))

        downloadedFiles = []
        for dirPath, dirNames, fileNames in os.walk(os.path.dirname(os.path.realpath(__file__))):
            for fileName in fileNames:
                if os.path.splitext(fileName)[1] == '.mp4' or os.path.splitext(fileName)[1] == '.mkv':
                    print fileName
                    downloadedFiles.append(fileName)

        for file in downloadedFiles:
            os.popen('lame -b ' + self.b + ' ' + file)


if __name__ == '__main__':
    opts, args = getopt.getopt(sys.argv[1:], 'p:b:')
    if len(sys.argv) < 2:
        print u'Usage: python ytbmp3Server.py [OPTIONS] URL [URL ...]'
    else:
        YTB = YtbMP3Server()
        YTB.download(opts, args)<commit_msg>fix files name bug when lame to mp3<commit_after>import os
import re
import sys, getopt

class YtbMP3Server:
    """docstring for YtbMP3Server"""
    def __init__(self):
        self.addresses = ''
        self.proxy = ''
        self.b = '320'

    def download(self, opts, args):
        for address in args:
            self.addresses += (' ' + address)

        for op, v in opts:
            if op == '-p':
                self.proxy = v
            elif op == '-b':
                slef.b = v

        print self.proxy
        if self.proxy == '':
            dl = os.popen('youtube-dl' + self.addresses).read()
        else:
            dl = os.popen('youtube-dl --proxy ' + self.proxy + self.addresses).read()
            # print os.path.dirname(os.path.realpath(__file__))

        downloadedFiles = []
        for dirPath, dirNames, fileNames in os.walk(os.path.dirname(os.path.realpath(__file__))):
            for fileName in fileNames:
                if os.path.splitext(fileName)[1] == '.mp4' or os.path.splitext(fileName)[1] == '.mkv':
                    print fileName
                    pattern = re.compile(r'$(')
                    downloadedFiles.append(fileName)

        for file in downloadedFiles:
            os.popen('lame -b ' + self.b + ' ' + '"' + file + '"')


if __name__ == '__main__':
    opts, args = getopt.getopt(sys.argv[1:], 'p:b:')
    if len(sys.argv) < 2:
        print u'Usage: python ytbmp3Server.py [OPTIONS] URL [URL ...]'
    else:
        YTB = YtbMP3Server()
        YTB.download(opts, args)
{'fraction_non_alphanumeric': 0.14047936085219706, 'fraction_numerical': 0.008322237017310254, 'mean_word_length': 1.7927509293680297, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1725828', 'n_tokens_mistral': 980, 'n_tokens_neox': 952, 'n_words': 224}