File tree Expand file tree Collapse file tree
pyrogram/types/messages_and_media Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616# You should have received a copy of the GNU Lesser General Public License
1717# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
1818
19- from typing import List
19+ from typing import List , Optional
2020
2121import pyrogram
2222from pyrogram import raw
@@ -80,10 +80,13 @@ def __init__(
8080 self .thumbs = thumbs
8181
8282 @staticmethod
83- def _parse (client , photo : "raw.types.Photo" , ttl_seconds : int = None ) -> "Photo" :
83+ def _parse (client , photo : "raw.types.Photo" , ttl_seconds : int = None ) -> Optional [ "Photo" ] :
8484 if isinstance (photo , raw .types .Photo ):
8585 big = photo .sizes [- 1 ]
8686
87+ if isinstance (big , raw .types .PhotoStrippedSize ):
88+ return None
89+
8790 if isinstance (big , raw .types .PhotoSizeProgressive ):
8891 big = raw .types .PhotoSize (
8992 type = big .type ,
You can’t perform that action at this time.
0 commit comments