mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 12:51:18 +00:00
Do not parse PhotoStrippedSize
This commit is contained in:
parent
384f4eba71
commit
c87177e7a6
@ -16,7 +16,7 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from typing import List
|
||||
from typing import List, Optional
|
||||
|
||||
import pyrogram
|
||||
from pyrogram import raw
|
||||
@ -80,10 +80,13 @@ class Photo(Object):
|
||||
self.thumbs = thumbs
|
||||
|
||||
@staticmethod
|
||||
def _parse(client, photo: "raw.types.Photo", ttl_seconds: int = None) -> "Photo":
|
||||
def _parse(client, photo: "raw.types.Photo", ttl_seconds: int = None) -> Optional["Photo"]:
|
||||
if isinstance(photo, raw.types.Photo):
|
||||
big = photo.sizes[-1]
|
||||
|
||||
if isinstance(big, raw.types.PhotoStrippedSize):
|
||||
return None
|
||||
|
||||
if isinstance(big, raw.types.PhotoSizeProgressive):
|
||||
big = raw.types.PhotoSize(
|
||||
type=big.type,
|
||||
|
Loading…
Reference in New Issue
Block a user