本文整理汇总了Python中BaseLib.Core.BitTornado.BT1.PiecePicker.PiecePicker.get_valid_range_iterator方法的典型用法代码示例。如果您正苦于以下问题:Python PiecePicker.get_valid_range_iterator方法的具体用法?Python PiecePicker.get_valid_range_iterator怎么用?Python PiecePicker.get_valid_range_iterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseLib.Core.BitTornado.BT1.PiecePicker.PiecePicker
的用法示例。
在下文中一共展示了PiecePicker.get_valid_range_iterator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_valid_range_iterator
# 需要导入模块: from BaseLib.Core.BitTornado.BT1.PiecePicker import PiecePicker [as 别名]
# 或者: from BaseLib.Core.BitTornado.BT1.PiecePicker.PiecePicker import get_valid_range_iterator [as 别名]
def get_valid_range_iterator(self):
if self.videostatus.live_streaming and self.videostatus.get_live_startpos() is None:
# Not hooked in, so cannot provide a sensible download range
# print >>sys.stderr,"PiecePickerStreaming: Not hooked in, valid range set to total"
return PiecePicker.get_valid_range_iterator(self)
# print >>sys.stderr,"PiecePickerStreaming: Live hooked in, or VOD, valid range set to subset"
first, last = self.videostatus.download_range()
return self.videostatus.generate_range((first, last))