<commit_before>{ stdenv, fetchFromGitHub, fetchpatch, pythonPackages, gocr, unrar, rhino, spidermonkey }:

let
  beautifulsoup = pythonPackages.callPackage ./beautifulsoup.nix {
    inherit pythonPackages;
  };

in pythonPackages.buildPythonApplication rec {
  version = "0.4.9-next";
  name = "pyLoad-" + version;

  src = fetchFromGitHub {
    owner = "pyload";
    repo = "pyload";
    rev = "721ea9f089217b9cb0f2799c051116421faac081";
    sha256 = "1ad4r9slx1wgvd2fs4plfbpzi4i2l2bk0lybzsb2ncgh59m87h54";
  };

  patches =
    let
      # gets merged in next release version of pyload
      configParserPatch = fetchpatch {
        url = "https://patch-diff.githubusercontent.com/raw/pyload/pyload/pull/2625.diff";
        sha256 = "1bisgx78kcr5c0x0i3h0ch5mykns5wx5wx7gvjj0pc71lfzlxzb9";
      };
      setupPyPatch = fetchpatch {
        url = "https://patch-diff.githubusercontent.com/raw/pyload/pyload/pull/2638.diff";
        sha256 = "006g4qbl582262ariflbyfrszcx8ck2ac1cpry1f82f76p4cgf6z";
      };
    in [ configParserPatch setupPyPatch ];

  buildInputs = [
    unrar rhino spidermonkey gocr pythonPackages.paver
  ];

  propagatedBuildInputs = with pythonPackages; [
    pycurl jinja2 beaker thrift simplejson pycrypto feedparser tkinter
    beautifulsoup send2trash
  ];

  #remove this once the PR patches above are merged. Needed because githubs diff endpoint
  #does not support diff -N
  prePatch = ''
    touch module/config/__init__.py
  '';

  preBuild = ''
    paver generate_setup
  '';

  doCheck = false;

  meta = {
    description = "Free and open source downloader for 1-click-hosting sites";
    homepage = https://github.com/pyload/pyload;
    license = stdenv.lib.licenses.gpl3;
    maintainers = [ stdenv.lib.maintainers.mahe ];
    platforms = stdenv.lib.platforms.all;
  };
}<commit_msg>pyload: fix build<commit_after>{ stdenv, fetchFromGitHub, fetchpatch, pythonPackages, gocr, unrar, rhino, spidermonkey }:

let
  beautifulsoup = pythonPackages.callPackage ./beautifulsoup.nix {
    inherit pythonPackages;
  };

in pythonPackages.buildPythonApplication rec {
  version = "0.4.9-next";
  name = "pyLoad-" + version;

  src = fetchFromGitHub {
    owner = "pyload";
    repo = "pyload";
    rev = "721ea9f089217b9cb0f2799c051116421faac081";
    sha256 = "1ad4r9slx1wgvd2fs4plfbpzi4i2l2bk0lybzsb2ncgh59m87h54";
  };

  patches =
    let
      # gets merged in next release version of pyload
      configParserPatch = fetchpatch {
        url = "https://patch-diff.githubusercontent.com/raw/pyload/pyload/pull/2625.diff";
        sha256 = "1bisgx78kcr5c0x0i3h0ch5mykns5wx5wx7gvjj0pc71lfzlxzb9";
      };
      setupPyPatch = fetchpatch {
        url = "https://patch-diff.githubusercontent.com/raw/pyload/pyload/pull/2638.diff";
        sha256 = "006g4qbl582262ariflbyfrszcx8ck2ac1cpry1f82f76p4cgf6z";
      };
    in [ configParserPatch setupPyPatch ];

  buildInputs = [
    unrar rhino spidermonkey gocr pythonPackages.paver
  ];

  propagatedBuildInputs = with pythonPackages; [
    pycurl jinja2 beaker thrift simplejson pycrypto feedparser tkinter
    beautifulsoup send2trash
  ];

  #remove this once the PR patches above are merged. Needed because githubs diff endpoint
  #does not support diff -N
  prePatch = ''
    touch module/config/__init__.py
  '';

  preBuild = ''
    ${pythonPackages.paver}/bin/paver generate_setup
  '';

  doCheck = false;

  meta = with stdenv.lib; {
    description = "Free and open source downloader for 1-click-hosting sites";
    homepage = https://github.com/pyload/pyload;
    license = licenses.gpl3;
    maintainers = [ maintainers.mahe ];
    platforms = platforms.all;
  };
}
{'fraction_non_alphanumeric': 0.09764770240700218, 'fraction_numerical': 0.057439824945295405, 'mean_word_length': 3.4761321909424723, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6431740', 'n_tokens_mistral': 1422, 'n_tokens_neox': 1334, 'n_words': 248}