Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "youtube-dl"]
path = youtube-dl
url = https://github.com/rg3/youtube-dl.git
3 changes: 3 additions & 0 deletions rips/view.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ def get_images_for_album(album, start, count, thumbs=False):
if dstart >= start and (dcount < count or count == -1):
image = '%s%s%s' % (roots, sep, f)
image = image.replace('%', '%25')
image = image.replace('\\', '/')
image = image.replace('/thumbs/', '/')
images.append( {
'image' : image,
'thumb' : get_thumb(image)
Expand Down Expand Up @@ -635,6 +637,7 @@ def get_keys(): # Retrieve key/value pairs from query, puts in dict
return keys

def get_thumb(img): # Get thumbnail based on image, or 'nothumb.png' if not found
img= img.replace("\\",sep) # silly windows
fs = img.split(sep)
fs.insert(-1, 'thumbs')
f = sep.join(fs)
Expand Down
19 changes: 14 additions & 5 deletions vid.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_video_url(siteurl):
})

def get_url(siteurl):
is_supported(siteurl)
# is_supported(siteurl)
sites = {
'videobam.com/' : { 'begend' : ['"', '"'], 'unquote' : 1 },
'xhamster.com/' : { 'begend' : ['"', '"'], 'unquote' : 1 },
Expand Down Expand Up @@ -74,6 +74,7 @@ def get_url(siteurl):
if 'cliphunter.com' in siteurl: return get_site_cliphunter(siteurl)
if 'spankwire.com' in siteurl: return get_site_spankwire(siteurl)
if 'kinkylicious.com' in siteurl: return get_site_kinkylicious(siteurl)
if 'youtube.com' in siteurl: return get_site_youtube(siteurl)

site_key = None
for key in sites.keys():
Expand All @@ -92,6 +93,14 @@ def get_url(siteurl):
url = unquote(url)
return url

def get_site_youtube(siteurl):
import sys
sys.path.append('youtube-dl')
import youtube_dl
yt = youtube_dl.YoutubeDL(param)
yt.add_default_info_extractors()
return yt.extract_info(siteurl)['entries'][0]['url']

def get_site_beeg(siteurl):
r = web.get(siteurl)
if not "'file': '" in r:
Expand Down Expand Up @@ -397,10 +406,10 @@ def get_site_kinkylicious(siteurl):
return 'http://kinkylicious.com/vdata/%s.flv' % vid


def is_supported(url):
for not_supported in ['youtube.com/']:
if not_supported in url:
raise Exception('%s is not supported' % not_supported)
# def is_supported(url):
# for not_supported in ['youtube.com/']:
# if not_supported in url:
# raise Exception('%s is not supported' % not_supported)

def get_deepest_ind(source, ext_inds):
deep_ind = 0
Expand Down
1 change: 1 addition & 0 deletions youtube-dl
Submodule youtube-dl added at dc65dc