Пример #1
0
 def __make_station(self, name, url):
 
     f = File(self)
     f.name = name
     f.info = url
     f.path = File.pack_path("/", name, url)
     f.resource = url
     if (url.endswith(".ram") or url.endswith(".rm")):
         f.mimetype = "application/vnd.rn-realmedia"
     else:
         f.mimetype = "audio/x-unknown"
     f.thumbnailer = "iradio.IRadioThumbnailer"
     f.thumbnailer_param = url
     
     return f
Пример #2
0
    def __make_video(self, path):
        """
        Creates a video file object from the given path.
        """

        prefix, title, info, video_id, thumbnail_url = File.unpack_path(path)

        f = File(self)
        f.name = title
        f.resource = video_id
        f.path = path
        f.mimetype = "video/x-flash-video"

        if (video_id == _REGION_BLOCKED):
            f.info = "This video cannot be viewed in your country."
            f.icon = theme.youtube_restricted.get_path()
        else:
            f.info = info
            f.thumbnailer = "youtube.YouTubeThumbnailer"
            f.thumbnailer_param = thumbnail_url

        return f