autodl-community / autodl-trackers

Tracker files for autodl-community fork of autodl-irssi
http://autodl.community
153 stars 129 forks source link

Add Category Information to GazelleGames #151

Closed ghost closed 7 years ago

ghost commented 8 years ago

Currently there is no category captured for GGN:

        <linepatterns>
            <extract>
                <!--user - Uploaded: || PC - Big_Rigs_Over_the_Road_Racing_NFO_FIX-Razor1911 in Big Rigs: Over the Road Racing [-2003-] - (English, Scene) - http://gazellegames.net/torrents.php?id=4684 -OR- http://gazellegames.net/torrents.php?action=download&id=7018 - racing -->
                <!--user - Uploaded: || Hatoful Boyfriend Holiday Star in Hatoful Boyfriend Holiday Star [-2012-] - (English, Home Rip) - http://gazellegames.net/torrents.php?id=4687 -OR- http://gazellegames.net/torrents.php?action=download&id=7019 - visual.novel,indie, adventure -->
                <regex value="^\s*(\S+) - Uploaded: \|\|(.*) - https?\:\/\/.*\s+https?\:\/\/([^\/]+\/)torrents.php\?action=download[&amp;\?]id=(\d+)\S*\s*.*"/>
                <vars>
                    <var name="uploader"/>
                    <var name="torrentName"/>
                    <var name="$baseUrl"/>
                    <var name="$torrentId"/>
                </vars>
            </extract>
        </linepatterns>

However the current announce scheme looks like this:

                <!--user - Uploaded: || Nintendo 3DS - AZURE STRIKER GUNVOLT 2  in AZURE STRIKER GUNVOLT 2 [-2016-] - (English, NTSC, ROM) - https://gazellegames.net/torrents.php?id=27081 -OR- https://gazellegames.net/torrents.php?action=download&id=65091 - action, role.playing.game -->
                <!--user - Uploaded: || Windows - Neverwinter.Nights.2.UPDATE.v1.06.973.PLUS.8.TRAINER-Unleashed in Neverwinter Nights 2 [-2006-] - (English, Scene) - https://gazellegames.net/torrents.php?id=1629 -OR- https://gazellegames.net/torrents.php?action=download&id=65090 - adventure, action, role_playing_game, fantasy, |, gog, lan_compatible, rpg_codexs_top_50_crpgs_of_all_time -->
                <!--user - Uploaded: || Playstation Portable - Corpse Party (PSN) in Corpse Party [-2010-] - (English, Full ISO) - https://gazellegames.net/torrents.php?id=4696 -OR- https://gazellegames.net/torrents.php?action=download&id=65039 - adventure, horror, survival, |, corpse_party, english_translated_visual_novels -->

As you can see, after the Uploaded: || and before the - torrentName is a category that could be used in filters.

Is it possible to fix this? New code could look like this (sorry my regex is not fierce):

        <linepatterns>
            <extract>
                <!--user - Uploaded: || Nintendo 3DS - AZURE STRIKER GUNVOLT 2  in AZURE STRIKER GUNVOLT 2 [-2016-] - (English, NTSC, ROM) - https://gazellegames.net/torrents.php?id=27081 -OR- https://gazellegames.net/torrents.php?action=download&id=65091 - action, role.playing.game -->
                <!--user - Uploaded: || Windows - Neverwinter.Nights.2.UPDATE.v1.06.973.PLUS.8.TRAINER-Unleashed in Neverwinter Nights 2 [-2006-] - (English, Scene) - https://gazellegames.net/torrents.php?id=1629 -OR- https://gazellegames.net/torrents.php?action=download&id=65090 - adventure, action, role_playing_game, fantasy, |, gog, lan_compatible, rpg_codexs_top_50_crpgs_of_all_time -->
                <regex value="^\s*(\S+) - Uploaded: \|\| ([a-zA-Z0-9\s]+) - (.*) - https?\:\/\/.*\s+https?\:\/\/([^\/]+\/)torrents.php\?action=download[&amp;\?]id=(\d+)\S*\s*.*"/>
                <vars>
                    <var name="uploader"/>
                    <var name="category"/>
                    <var name="torrentName"/>
                    <var name="$baseUrl"/>
                    <var name="$torrentId"/>
                </vars>
            </extract>
        </linepatterns>
thebigmunch commented 7 years ago

Looking at the list of categories, it's both possible to have a '-' character in a category and a '-' surrounded by spaces, so it'd definitely require a more advanced regex than that.

Edit: There are also some other characters in current categories that aren't covered. And then you have to consider the possibility of them being there even if they aren't now. Honestly, the ideal thing to do would be to ask for them to separate/move the category (technically called Platform on GGn) in a way to be more easily parsed.

thebigmunch commented 7 years ago

As an extra thought, the same could be said for their release tags (i.e. '(English, Scene)'). Really, the entire announce could be much better formatted both for human and programmatic parsing.