当前位置: 首页>>代码示例>>Python>>正文


Python ImageUtils.get_urls方法代码示例

本文整理汇总了Python中ImageUtils.ImageUtils.get_urls方法的典型用法代码示例。如果您正苦于以下问题:Python ImageUtils.get_urls方法的具体用法?Python ImageUtils.get_urls怎么用?Python ImageUtils.get_urls使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageUtils.ImageUtils的用法示例。


在下文中一共展示了ImageUtils.get_urls方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: process_url

# 需要导入模块: from ImageUtils import ImageUtils [as 别名]
# 或者: from ImageUtils.ImageUtils import get_urls [as 别名]
	def process_url(self, url, url_index, child):
		self.debug('process_url: %s' % url)
		userid = self.db.get_user_id(child.author)
		if type(child) == Post:
			base_fname = '%s-%d' % (child.id, url_index)
			postid = child.id
			commid = None
		elif type(child) == Comment:
			base_fname = '%s-%s-%d' % (child.post_id, child.id, url_index)
			postid = child.post_id
			commid = child.id

		working_dir = path.join(ImageUtils.get_root(), 'content', child.author)

		# A single URL can contain multiple medias (i.e. albums)
		try:
			(media_type, albumname, medias) = ImageUtils.get_urls(url)
		except Exception, e:
			self.debug('%s: process_url: unable to get URLs for %s: %s' % (child.author, url, str(e)))
			return
开发者ID:ohhdemgirls,项目名称:gonewilder,代码行数:22,代码来源:Gonewild.py

示例2: process_url

# 需要导入模块: from ImageUtils import ImageUtils [as 别名]
# 或者: from ImageUtils.ImageUtils import get_urls [as 别名]
	def process_url(self, url, url_index, child):
		self.debug('%s: process_url: %s' % (child.author, url))

		# Ignore duplicate albums
		if self.db.album_exists(url):
			self.debug('''%s: process_url: album %s already exists in database.
Permalink: %s
   Object: %s''' % (child.author, url, child.permalink(), str(child)))
			return

		userid = self.db.get_user_id(child.author)
		if type(child) == Post:
			base_fname = '%s-%d' % (child.id, url_index)
			postid = child.id
			commid = None
		elif type(child) == Comment:
			base_fname = '%s-%s-%d' % (child.post_id, child.id, url_index)
			postid = child.post_id
			commid = child.id

		working_dir = path.join(ImageUtils.get_root(), 'content', child.author)

		# A single URL can contain multiple medias (i.e. albums)
		try:
			(media_type, albumname, medias) = ImageUtils.get_urls(url)
		except Exception, e:
			self.debug('%s: process_url: unable to get URLs for %s: %s' % (child.author, url, str(e)))
			if 'domain not supported' in str(e):
				# Save domain-not-supported URLs to new file
				user_dir = path.join(ImageUtils.get_root(), 'content', child.author)
				f = open(path.join(user_dir, 'unsupported.txt'), 'a')
				f.write(url)
				f.write('\n')
				f.flush()
				f.close()
			return
开发者ID:4pr0n,项目名称:gonewilder,代码行数:38,代码来源:Gonewild.py

示例3: main

# 需要导入模块: from ImageUtils import ImageUtils [as 别名]
# 或者: from ImageUtils.ImageUtils import get_urls [as 别名]
	def main(self):
		
		url='http://i.reddituploads.com/565bfd920d114339930a3e2407a5d967'
		ImageUtils.get_urls(url)
开发者ID:mkdfgj,项目名称:gwstar,代码行数:6,代码来源:test.py


注:本文中的ImageUtils.ImageUtils.get_urls方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。