def isRedirectingToOtherDomain(url: str) -> int:
    try:
        domainOriginal = utils.getDomainAndSuffixFromUrl(url)
        urlAfter = utils.getFinalDestinationUrl(url)
        domainAfter = utils.getDomainAndSuffixFromUrl(urlAfter)
        if domainOriginal != domainAfter:
            return 1
        return 0
    except:
        return -1
Esempio n. 2
0
 def test2leveldotcomdothk(self):
     self.assertEqual(utils.getDomainAndSuffixFromUrl('a.b.c.com.hk'),
                      'c.com.hk')
Esempio n. 3
0
 def test1leveldotcom(self):
     self.assertEqual(utils.getDomainAndSuffixFromUrl('a.b.com'), 'b.com')