[netease:djradio] Use compat_itertools_count
authorYen Chi Hsuan <yan12125@gmail.com>
Fri, 10 Jul 2015 10:59:12 +0000 (18:59 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Fri, 10 Jul 2015 10:59:12 +0000 (18:59 +0800)
youtube_dl/extractor/neteasemusic.py

index 9e99ddbdad099d2f4b8427f7b16c2006ac5e5ff3..bdfe7e63f854d8e130043340b5bed2d18da0017e 100644 (file)
@@ -4,7 +4,6 @@ from __future__ import unicode_literals
 from hashlib import md5
 from base64 import b64encode
 from datetime import datetime
-import itertools
 import re
 
 from .common import InfoExtractor
@@ -12,6 +11,7 @@ from ..compat import (
     compat_urllib_request,
     compat_urllib_parse,
     compat_str,
+    compat_itertools_count,
 )
 
 
@@ -428,7 +428,7 @@ class NetEaseMusicDjRadioIE(NetEaseMusicBaseIE):
         name = None
         desc = None
         entries = []
-        for offset in itertools.count(start=0, step=self._PAGE_SIZE):
+        for offset in compat_itertools_count(start=0, step=self._PAGE_SIZE):
             info = self.query_api(
                 'dj/program/byradio?asc=false&limit=%d&radioId=%s&offset=%d'
                 % (self._PAGE_SIZE, dj_id, offset),