<commit_before>#!/usr/bin/env python
# coding:utf-8

import os
import re
import requests
import argparse


class ParseArgs(object):
    '''parser command line args'''
    def __init__(self):
        pass

    def mv_id(self):
        _parser = argparse.ArgumentParser(
            description='Download cloud music MV'
        )
        _parser.add_argument('mv_id')
        self.args = _parser.parse_args()
        return self.args.mv_id

    def __str__(self):
        return self.args.mv_id

    __repr__ = __str__


class DownloadMV(object):
    def __init__(self, mv_id, _mv_url=''):
        self.mv_id = mv_id
        self._mv_url = _mv_url

    def mv_url(self):
        html = requests.get(
            'http://music.163.com/mv?id={0}'.format(self.mv_id)
        ).text
        _mv_url = re.findall('murl=(.+\.mp4)', html)[0]
        self._mv_url = re.findall('murl=(.+\.mp4)', html)[0]
        print 'url: ', _mv_url
        return _mv_url

    def download(self):
        '''
        first method....
        also can urllib.urlretrieve
        '''
        print self._mv_url
        os.system('wget {0}'.format(self._mv_url))


def start():
    parser = ParseArgs()
    mv_id = parser.mv_id()
    print mv_id
    main = DownloadMV(mv_id)
    main.download()


if __name__ == '__main__':
    start()<commit_msg>revise cloudmusicmv<commit_after>#!/usr/bin/env python
# coding:utf-8

import os
import re
import requests
import argparse


class ParseArgs(object):
    '''parser command line args'''
    def __init__(self):
        pass

    def mv_id(self):
        _parser = argparse.ArgumentParser(
            description='Download cloud music MV'
        )
        _parser.add_argument('mv_id')
        self.args = _parser.parse_args()
        return self.args.mv_id

    def __str__(self):
        return self.args.mv_id

    __repr__ = __str__


class DownloadMV(object):
    def __init__(self, mv_id, _mv_url=''):
        self.mv_id = mv_id
        self._mv_url = _mv_url

    def mv_url(self):
        html = requests.get(
            'http://music.163.com/mv?id={0}'.format(self.mv_id)
        ).text
        self._mv_url = re.findall('murl=(.+\.mp4)', html)[0]
        return self._mv_url

    def download(self, url):
        '''
        first method....
        also can urllib.urlretrieve
        '''
        os.system('wget {0}'.format(url))


def start():
    parser = ParseArgs()
    mv_id = parser.mv_id()
    print mv_id
    main = DownloadMV(mv_id)
    url = main.mv_url()
    main.download(url)


if __name__ == '__main__':
    start()
{'fraction_non_alphanumeric': 0.13114754098360656, 'fraction_numerical': 0.00702576112412178, 'mean_word_length': 2.211779448621554, 'pattern_counts': {'":': 0, '<': 3, '<?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': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6856460', 'n_tokens_mistral': 907, 'n_tokens_neox': 871, 'n_words': 179}