Added some changes

This commit is contained in:
Manuel Cortez 2017-04-30 16:09:11 -05:00
parent ead1f186f0
commit ae5ec93b53
2 changed files with 23 additions and 0 deletions

View File

@ -11,4 +11,5 @@ def create_archive():
shutil.make_archive("socializer-nightly-build", "zip", "socializer")
shutil.rmtree("socializer")
create_build()
create_archive()

View File

@ -18,3 +18,25 @@ class client(object):
soup = bs(page.content, "lxml")
url = soup.find('form')['action']
p = self.session.post(url, data=payload, headers=self.headers)
def get_audios(self, user=None):
if user == None:
url = "https://m.vk.com/audio"
else:
url = "https://m.vk.com/audios{0}".format(user,)
content = self.session.get(url)
soup = bs(content.content, "lxml")
divs = soup.find_all("div", class_="ai_info")
return divs
def parse_audio_info(self, info):
artist = info("span", class_="ai_artist")[0].text
year = info("span", class_="divider")[0].text
title = info("span", class_="ai_title")[0].text
duration = info("div", class_="ai_dur")[0].text
return artist, title, year, duration
def get_audio_url(self, url):
if url == "" or url == None:
return ""
values = url.split("?extra=")[1].split("#")