Skip to content

Instantly share code, notes, and snippets.

@pierreant-p
Last active December 6, 2016 07:15
Show Gist options
  • Save pierreant-p/9d951220f92369aa219a to your computer and use it in GitHub Desktop.
Save pierreant-p/9d951220f92369aa219a to your computer and use it in GitHub Desktop.
sketchfab oembed patterns
import re
# urls for matching models
regex = re.compile(r'^http(s?)://sketchfab.com/(show|models)/(?P<urlid>\w+)')
# Examples
https://sketchfab.com/models/62d77e6a14284e91b2f737d6909e965d
https://sketchfab.com/models/b7LzIm8JrnPw4GBDOMBNGYc39qM
https://sketchfab.com/models/4f4802d5c24847fda35408eed5f9a066
# urls for matching users
regex = re.compile(r'^http(s?)://sketchfab.com/(?P<username>[a-zA-Z0-9._-]{2,})$')
# Examples
https://sketchfab.com/pa
https://sketchfab.com/alban
https://sketchfab.com/kid.in.the.dark
https://sketchfab.com/dennish2010
# users for matching folders/collections
# NOTE: collections is not currently a valid urls, but it will become one in the coming weeks
regex = re.compile(r'^http(s?)://sketchfab.com/(?P<username>[a-zA-Z0-9._-]{2,})/(folders|collections)/(?P<folder_slug>.+)$')
# Examples
https://sketchfab.com/dennish2010/folders/modular-sci-fi-set
https://sketchfab.com/pa/folders/space-hulk-terminators
https://sketchfab.com/alban/folders/voxel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment