Skip to content

Instantly share code, notes, and snippets.

View VeryCB's full-sized avatar

VeryCB VeryCB

View GitHub Profile
@VeryCB
VeryCB / count_code_lines
Created September 15, 2013 16:56
count all lines of python code, ignoring `venv` directory
find . -path ./venv -prune -o -name '*.py' | xargs wc -l
@VeryCB
VeryCB / taoke_url_2_real_url
Last active October 3, 2020 07:59
将淘客URL转换为商品的真实URL
#!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
import urllib
def get_real_url(taoke_url):
_refer = requests.get(taoke_url).url
headers = {'Referer': _refer}
return requests.get(urllib.unquote(_refer.split('tu=')[1]), headers=headers).url.split('&ali_trackid=')[0]