Skip to content

Instantly share code, notes, and snippets.

@Hammer2900
Created May 25, 2015 13:09
Show Gist options
  • Save Hammer2900/edc40e52d880a44fe5d4 to your computer and use it in GitHub Desktop.
Save Hammer2900/edc40e52d880a44fe5d4 to your computer and use it in GitHub Desktop.
normalize string
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pafy
import re
url = "https://www.youtube.com/watch?v=h1klFHmcw64"
video = pafy.new(url)
print video.title
def normalize_name(stringss):
return re.sub("\s+", '', stringss)
print normalize_name(video.title)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment