domains.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:script.reddit.reader 作者: gedisony 项目源码 文件源码
def get_playable_url(self, link_url, is_probably_a_video):
        from reddit import assemble_reddit_filter_string
        subreddit=self.get_video_id(link_url)
        self.video_id=subreddit
        #log('    **get_playable_url subreddit=' + self.video_id )

        self.media_type=sitesBase.TYPE_REDDIT

        #if link_url is in the form of https://np.reddit.com/r/teslamotors/comments/50bc6a/tesla_bumped_dying_man_up_the_production_queue_so/d72vfbg?context=2
        if '/comments/' in link_url:
            self.link_action='listLinksInComment'
            return link_url, self.media_type
        else:
            #link_url is in the form of "r/subreddit". this type of link is found in comments
            if subreddit:
                self.link_action='listSubReddit'
                reddit_url=assemble_reddit_filter_string('',subreddit)
                return reddit_url, self.media_type
            if link_url.startswith('/u/'):
                author=link_url.split('/u/')[1]
                self.link_action='listSubReddit'
                #show links submitted by author
                reddit_url=assemble_reddit_filter_string("","/user/"+author+'/submitted')
                return reddit_url, self.media_type
        return '',''
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号