(imap_address, email_address, password, verified_creds)
return links
Checks email for torrent links from verified accounts
    Args:
        imap_address (str): email providers imap address
        email_address (str): email address
        password (str): password for email
        verified_creds (dict): dict containing verfied email and password
Checks email for torrent links from verified accounts
    Args:
        imap_address (str): email providers imap address
        email_address (str): email address
        password (str): password for email
        verified_creds (dict): dict containing verfied email and password
Checks email for torrent links from verified accounts Args : imap_address ( str ) : email providers imap address email_address ( str ) : email address password ( str ) : password for email verified_creds ( dict ) : dict containing verfied email and password
def check_for_torrents(imap_address, email_address, password, verified_creds):
    """Checks email for torrent links from verified accounts
    Args:
        imap_address (str): email providers imap address
        email_address (str): email address
        password (str): password for email
        verified_creds (dict): dict containing verfied email and password
    """
    imaplib._MAXLINE = 10000000
    imapObj = imapclient.IMAPClient(imap_address, ssl=True)
    # See https://support.google.com/accounts/answer/6010255 if (Login Error)
    imapObj.login(email_address, password)
    imapObj.select_folder('INBOX', readonly=True)
    UIDs = imapObj.search(['FROM ' + verified_creds['email']])

    links = []
    if UIDs:
        for u in UIDs:
            rawMessages = imapObj.fetch([u], ['BODY[]', 'FLAGS'])
            message = pyzmail.PyzMessage.factory(rawMessages[u][b'BODY[]'])
            text = message.text_part.get_payload().decode(message.text_part.charset)

            if verified_creds['password'] in text:
                html = message.html_part.get_payload().decode(message.html_part.charset)
                links.append(html)

        imapObj.delete_messages(UIDs)
        imapObj.expunge()
    
    imapObj.logout()

    return links
def check_for_torrents ( imap_address , email_address , password , verified_creds ) : imaplib . _MAXLINE = 10000000 imapObj = imapclient . IMAPClient ( imap_address , ssl = True ) # See https://support.google.com/accounts/answer/6010255 if (Login Error) imapObj . login ( email_address , password ) imapObj . select_folder ( 'INBOX' , readonly = True ) UIDs = imapObj . search ( [ 'FROM ' + verified_creds [ 'email' ] ] ) links = [ ] if UIDs : for u in UIDs : rawMessages = imapObj . fetch ( [ u ] , [ 'BODY[]' , 'FLAGS' ] ) message = pyzmail . PyzMessage . factory ( rawMessages [ u ] [ b'BODY[]' ] ) text = message . text_part . get_payload ( ) . decode ( message . text_part . charset ) if verified_creds [ 'password' ] in text : html = message . html_part . get_payload ( ) . decode ( message . html_part . charset ) links . append ( html ) imapObj . delete_messages ( UIDs ) imapObj . expunge ( ) imapObj . logout ( ) return links